Skip to content

Commit

Permalink
Merge pull request #9361 from magento-gl/ACQE-7152-mainline-functiona…
Browse files Browse the repository at this point in the history
…l-tests-deployment

[Bengals] | Functional Tests Mainline Deployment
  • Loading branch information
2 parents 915e8fe + 25f317a commit 7939bd0
Show file tree
Hide file tree
Showing 45 changed files with 2,137 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
* Copyright 2024 Adobe
* All Rights Reserved.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminLoginWithCustomUrlActionGroup" extends="AdminLoginActionGroup">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright 2024 Adobe
* All Rights Reserved.
*/
-->
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminAddImageCategoryAtAllStoreViewActionGroup">
<annotations>
<description>Requires navigation to the Category creation/edit page. Adds the provided image to a Category.</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"/>
<waitForPageLoad stepKey="waitForFileUpload1"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright 2024 Adobe
* All Rights Reserved.
*/
-->
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminAssertCategoryImageActionGroup">
<annotations>
<description>Assert category image on admin.</description>
</annotations>
<arguments>
<argument name="image" type="entity"/>
</arguments>
<conditionalClick selector="{{AdminCategoryContentSection.sectionHeader}}" dependentSelector="{{AdminCategoryContentSection.uploadButton}}" visible="false" stepKey="openContentSection"/>
<waitForPageLoad time="30" stepKey="waitForPageLoad"/>
<waitForElementVisible selector="{{AdminCategoryContentSection.imageFileName}}" stepKey="waitForLoading"/>
<grabTextFrom selector="{{AdminCategoryContentSection.imageFileName}}" stepKey="grabCategoryFileName"/>
<assertRegExp stepKey="assertEquals" message="pass">
<expectedResult type="string">/{{image.filename}}(_[0-9]+)*?\.(jpg|png)$/</expectedResult>
<actualResult type="variable">grabCategoryFileName</actualResult>
</assertRegExp>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright 2024 Adobe
* All Rights Reserved.
*/
-->
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminAssertCategoryNoImageActionGroup">
<annotations>
<description>Assert category no image on admin.</description>
</annotations>
<conditionalClick selector="{{AdminCategoryContentSection.sectionHeader}}" dependentSelector="{{AdminCategoryContentSection.uploadButton}}" visible="false" stepKey="openContentSection"/>
<waitForPageLoad time="30" stepKey="waitForPageLoad"/>
<dontSee selector="{{AdminCategoryContentSection.imageFileName}}" stepKey="dontSeeImage"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright 2024 Adobe
* All Rights Reserved.
*/
-->
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminChangeCategoryImageOnStoreviewActionGroup">
<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"/>
<uncheckOption selector="{{AdminCategoryContentSection.categoryImageUseDefault}}" stepKey="uncheckUseDefaultValueStoreView"/>
<waitForElementVisible selector="{{AdminCategoryContentSection.uploadButton}}" stepKey="seeImageSectionIsReady"/>
<attachFile selector="{{AdminCategoryContentSection.uploadImageFile}}" userInput="{{image.file}}" stepKey="uploadFile"/>
<waitForPageLoad stepKey="waitForFileUpload1"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright 2024 Adobe
* All Rights Reserved.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminSelectValueForVisibleOnStorefrontActionGroup">
<annotations>
<description>Admin Select Yes for visible on Storefront on product attribute page.</description>
</annotations>
<arguments>
<argument name="catalogPagesValue" type="string" defaultValue="Yes"/>
</arguments>
<waitForElementClickable selector="{{StorefrontPropertiesSection.StoreFrontPropertiesTab}}" stepKey="waitForStorefrontPropertiesTabToBeClickable"/>
<click selector="{{StorefrontPropertiesSection.StoreFrontPropertiesTab}}" stepKey="clickStorefrontPropertiesTab"/>
<waitForElement selector="{{StorefrontPropertiesSection.visibleOnCatalogPagesOnStorefront}}" stepKey="waitForVisibleOnCatalogElement"/>
<selectOption selector="{{StorefrontPropertiesSection.visibleOnCatalogPagesOnStorefront}}" userInput="{{catalogPagesValue}}" stepKey="enableVisibleOnStorefront"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright 2024 Adobe
* All Rights Reserved.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminSetCatalogPriceToWebsiteActionGroup">
<annotations>
<description> Admin set catalog price scope to website.</description>
</annotations>
<magentoCLI command="config:set {{WebsiteCatalogPriceScopeConfigData.path}} {{WebsiteCatalogPriceScopeConfigData.value}}" stepKey="setSetCatalogPriceToWebsite"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright 2024 Adobe
* All Rights Reserved.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminSetDefaultCatalogPriceActionGroup">
<annotations>
<description> Admin set catalog price scope to default.</description>
</annotations>
<magentoCLI command="config:set {{GlobalCatalogPriceScopeConfigData.path}} {{GlobalCatalogPriceScopeConfigData.value}}" stepKey="setSetCatalogPriceToWebsite"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright 2024 Adobe
* All Rights Reserved.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminUpdateAttributeValuesOnProductDetailsPageActionGroup">
<annotations>
<description>Admin Update attribute values on product details page.</description>
</annotations>
<arguments>
<argument name="taxValue" type="string" defaultValue="None"/>
<argument name="weightValue" type="string" defaultValue="1"/>
<argument name="visibilityValue" type="string" defaultValue="Search"/>
<argument name="country" type="string" defaultValue="Afghanistan"/>
</arguments>
<waitForElement selector="{{AdminProductFormSection.productTaxClass}}" stepKey="waitForProductTaxClassFieldToBeVisible"/>
<selectOption selector="{{AdminProductFormSection.productTaxClass}}" userInput="{{taxValue}}" stepKey="selectProductTaxClass"/>
<waitForElementVisible selector="{{AdminProductFormSection.productWeight}}" stepKey="waitForSimpleProductWeightToBeVisible"/>
<fillField selector="{{AdminProductFormSection.productWeight}}" userInput="{{weightValue}}" stepKey="fillSimpleProductWeight"/>
<waitForElement selector="{{AdminProductFormSection.visibility}}" stepKey="waitForVisibilityToBeVisible"/>
<selectOption selector="{{AdminProductFormSection.visibility}}" userInput="{{visibilityValue}}" stepKey="selectVisibility"/>
<waitForElement selector="{{AdminProductFormSection.countryOfManufacture}}" stepKey="waitForCountryOfManufactureToBeVisible"/>
<selectOption selector="{{AdminProductFormSection.countryOfManufacture}}" userInput="{{country}}" stepKey="selectCountryOfManufacture"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright 2024 Adobe
* All Rights Reserved.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="StorefrontAssertCustomOptionValuesInProductDetailsPageActionGroup">
<annotations>
<description>Storefront Assert Custom Option Values In Product Details Page.</description>
</annotations>
<arguments>
<argument name="firstOption" type="string" defaultValue="Value2"/>
<argument name="secondOption" type="string" defaultValue="Value3"/>
</arguments>
<waitForElementVisible selector="{{StorefrontProductInfoMainSection.selectCustomOptionDropDown}}" stepKey="waitForOptionDropDownToBeClickable"/>
<click selector="{{StorefrontProductInfoMainSection.selectCustomOptionDropDown}}" stepKey="clickOption1ValueDropDown"/>
<waitForElement selector="{{StorefrontProductInfoMainSection.customOptionDropDown(firstOption)}}" stepKey="assertValue1InDropDown"/>
<waitForElement selector="{{StorefrontProductInfoMainSection.customOptionDropDown(secondOption)}}" stepKey="assertValue2InDropDown"/>
<waitForElementVisible selector="{{StorefrontProductInfoMainSection.selectCustomOptionDropDown}}" stepKey="againWaitForOptionDropDownToClose"/>
<click selector="{{StorefrontProductInfoMainSection.selectCustomOptionDropDown}}" stepKey="againClickOptionValueDropDownToClose"/>
</actionGroup>
</actionGroups>

Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright 2024 Adobe
* All Rights Reserved.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="StorefrontAssertProductAndAttributeValuesOnProductPageActionGroup">
<annotations>
<description>Storefront assert attribute values on product details page.</description>
</annotations>
<arguments>
<argument name="productName" type="string" defaultValue="simple-product-UPDATED"/>
<argument name="productPrice" type="string" defaultValue="5.50"/>
<argument name="taxValue" type="string" defaultValue="Taxable Goods"/>
<argument name="weightValue" type="string" defaultValue="10.000000"/>
<argument name="country" type="string" defaultValue="Zimbabwe"/>
</arguments>
<waitForText selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{productName}}" stepKey="seeProductNameInTitle"/>
<waitForText selector="{{StorefrontProductInfoMainSection.price}}" userInput="{{productPrice}}" stepKey="seeProductPrice"/>
<waitForText selector="{{StorefrontProductPageSection.attributeTypes('Tax Class')}}" userInput="{{taxValue}}" stepKey="assertTaxAttribute"/>
<waitForText selector="{{StorefrontProductPageSection.attributeTypes('Weight')}}" userInput="{{weightValue}}" stepKey="assertWeightAttribute"/>
<waitForText selector="{{StorefrontProductPageSection.attributeTypes('Country of Manufacture')}}" userInput="{{country}}" stepKey="assertCountryOfManufactureAttribute"/>
</actionGroup>
</actionGroups>
6 changes: 6 additions & 0 deletions app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1574,4 +1574,10 @@
<requiredEntity type="product_extension_attribute">EavStock1</requiredEntity>
<requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity>
</entity>
<entity name="productWithTwoCustomOptions" type="product">
<var key="sku" entityType="product" entityKey="sku" />
<data key="file">magento.jpg</data>
<requiredEntity type="product_option">ProductOptionDropDownFor2</requiredEntity>
<requiredEntity type="product_option">ProductOptionCheckboxFor2</requiredEntity>
</entity>
</entities>
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
* Copyright 2024 Adobe
* All Rights Reserved.
*/
-->

<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="AdminCategoryContentSection">
Expand All @@ -26,5 +25,6 @@
<element name="productTableRow" type="button" selector="#catalog_category_products_table tbody tr"/>
<element name="productSearch" type="button" selector="//button[@data-action='grid-filter-apply']" timeout="30"/>
<element name="productTableColumnSku" type="input" selector="#catalog_category_products_filter_sku"/>
<element name="categoryImageUseDefault" type="checkbox" selector="input[name='use_default[image]']"/>
</section>
</sections>
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
* Copyright 2024 Adobe
* All Rights Reserved.
*/
-->

Expand Down Expand Up @@ -50,5 +50,6 @@
<element name="productNameWithPriceOrLabel" type="text" selector="//div[@class='product details product-item-details']//a[contains(text(),'{{ProductName}}')]//parent::strong/following-sibling::div//span[contains(text(),'{{PriceLabelOrPrice}}')]" parameterized="true"/>
<element name="sortByDropdownContent" type="select" selector="//select[@id='sorter']//option[contains(text(),'{{arg}}')]" parameterized="true"/>
<element name="productInOrderDisplay" type="text" selector="//li[@class='item product product-item'][{{index}}]//a[@class='product-item-link' and contains(text(),'{{product_name}}')]" parameterized="true"/>
<element name="enableCookies" type="text" selector="//a//span[contains(text(),'Enable Cookies')]"/>
</section>
</sections>
Loading

0 comments on commit 7939bd0

Please sign in to comment.