Skip to content

MFTF: Extract Action Groups to separate files - magento/module-product-video #25813

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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>
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="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>
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="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>
Original file line number Diff line number Diff line change
@@ -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>
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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>
Original file line number Diff line number Diff line change
@@ -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>
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
*/
-->

<!--
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">
<!-- 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>
Expand All @@ -17,6 +20,7 @@
<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"/>
Expand All @@ -31,19 +35,18 @@
<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>

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

<!-- 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>
Expand All @@ -52,14 +55,14 @@
<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>

<!-- 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>
Expand All @@ -68,10 +71,35 @@
<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>
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Original file line number Diff line number Diff line change
Expand Up @@ -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"/>
Expand All @@ -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}}"/>
Expand Down