Skip to content

Commit

Permalink
ENGCOM-6406: MFTF: Extract Action Groups to separate files - magento/…
Browse files Browse the repository at this point in the history
…module-downloadable #25825
  • Loading branch information
VladimirZaets committed Dec 6, 2019
2 parents 0d8cb90 + e109691 commit fb1521f
Show file tree
Hide file tree
Showing 28 changed files with 194 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -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>
Original file line number Diff line number Diff line change
@@ -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>
Original file line number Diff line number Diff line change
@@ -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>
Original file line number Diff line number Diff line change
@@ -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>
Original file line number Diff line number Diff line change
@@ -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>
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,36 @@
*/
-->

<!--
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">
<!--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>


<!-- 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>

<!--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>


<!-- 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"/>
Expand All @@ -44,7 +48,6 @@
<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>
Expand All @@ -53,7 +56,8 @@
<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"/>
Expand All @@ -67,15 +71,15 @@
<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>


<!-- 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"/>
Expand All @@ -84,15 +88,15 @@
<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>


<!-- 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"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
Loading

0 comments on commit fb1521f

Please sign in to comment.