Skip to content
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

feat: Added MFTF tests for the imgix module #37

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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,9 @@
<?xml version="1.0" encoding="UTF-8"?>

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminSaveConfigErrorActionGroup">
<click selector="{{AdminConfigSection.saveButton}}" stepKey="clickSaveConfigBtn"/>
<waitForElementVisible selector="{{AdminMessagesSection.error}}" stepKey="waitForErrorMessage"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<?xml version="1.0" encoding="UTF-8"?>
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="CreateConfigurableProductAddImgixImageActionGroup">
<annotations>
<description>Goes to the Admin Product grid page. Creates a Configurable Product using the default Product Options.Add imgix image to image section.</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"/>
<!-- Add imgix Image -->
<click selector="{{AdminProductImagesSection.productImagesToggle}}" stepKey="expandImages"/>
<click selector="{{AdminProductImagesSection.addImgixImage}}" stepKey="addImgixImages"/>
<click selector="{{AdminProductImagesSection.selectFirstImgixImage}}" stepKey="selectFirstImgixImage"/>
<click selector="{{AdminProductImagesSection.addImage}}" stepKey="addImage"/>
<!-- 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>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="DragContentTypeImgixToStage">
<arguments>
<argument name="contentType"/>
<argument name="containerTargetType" defaultValue="PageBuilderRowContentType"/>
<argument name="containerTargetIndex" defaultValue="1" type="string"/>
</arguments>
<waitForElementVisible time="30" selector="{{PageBuilderPanel.draggableContentTypeInPanel(contentType.name)}}" stepKey="waitForContentTypeInPanel"/>
<dragAndDrop selector1="{{PageBuilderPanel.draggableContentTypeInPanel(contentType.name)}}" selector2="{{PageBuilderStage.contentTypeContainer(containerTargetType.role, containerTargetIndex)}}" stepKey="dropContentTypeIntoStage"/>
<waitForPageLoad stepKey="waitForAnimation" time="30"/>
<!-- <dontSeeJsError stepKey="doNotSeeJSErrorInConsole"/> -->
<click selector="{{AdminPagebuiderImgixImageSection.pagebuilderAddImgixImage}}" stepKey="clickPagebuilderAddImgixImageBtn"/>
<click selector="{{AdminPagebuiderImgixImageSection.pagebuilderSelectFirstImgixImage}}" stepKey="selectPageBuilderFirstImgixImage"/>
<click selector="{{AdminPagebuiderImgixImageSection.pagebuilderAddImage}}" stepKey="clickPagebuilderAddImage"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="FillImgixImagePanelFieldImgixConfigActionGroup">
<annotations>
<description>Save `imgix width` value to `imgix image configuration` section.</description>
</annotations>
<arguments>
<argument name="imgix_width" type="string" defaultValue="{{PageBuilderImgixImageProperty_ImgixWidth.value}}"/>
<argument name="imgix_height" type="string" defaultValue="{{PageBuilderImgixImageProperty_ImgixHeight.value}}"/>
<argument name="imgix_format" type="string" defaultValue="{{PageBuilderImgixImageProperty_ImgixFormat.value}}"/>
<argument name="imgix_auto" type="string" defaultValue="{{PageBuilderImgixImageProperty_ImgixAuto.value}}"/>
<argument name="imgix_crop" type="string" defaultValue="{{PageBuilderImgixImageProperty_ImgixCrop.value}}"/>
</arguments>
<fillField selector="{{AdminPagebuiderImgixImageSection.imgixWidth}}" userInput="{{imgix_width}}" stepKey="fillImgixWidth"/>
<fillField selector="{{AdminPagebuiderImgixImageSection.imgixHeight}}" userInput="{{imgix_height}}" stepKey="fillImgixHeight"/>
<fillField selector="{{AdminPagebuiderImgixImageSection.imgixFormat}}" userInput="{{imgix_format}}" stepKey="fillImgixFormat"/>
<fillField selector="{{AdminPagebuiderImgixImageSection.imgixAuto}}" userInput="{{imgix_auto}}" stepKey="fillImgixAuto"/>
<fillField selector="{{AdminPagebuiderImgixImageSection.imgixCrop}}" userInput="{{imgix_crop}}" stepKey="fillImgixCrop"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="FillAdminSimpleProductFormWithImgixImageActionGroup">
<annotations>
<description>Goes to the Admin Product grid page. Clicks on Add. Fills the provided Product details (Name, SKU, Price, Quantity, Category and URL). Add Imgix Image. 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"/>
<selectOption userInput="{{simpleProduct.visibility}}" selector="{{AdminProductFormSection.visibility}}" stepKey="fillVisibility"/>
<searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[{{category.name}}]" stepKey="searchAndSelectCategory"/>
<click selector="{{AdminProductImagesSection.productImagesToggle}}" stepKey="expandImages"/>
<click selector="{{AdminProductImagesSection.addImgixImage}}" stepKey="addImgixImages"/>
<click selector="{{AdminProductImagesSection.selectFirstImgixImage}}" stepKey="selectFirstImgixImage"/>
<click selector="{{AdminProductImagesSection.addImage}}" stepKey="addImage"/>
<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>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="NavigateToDefaultLayoutsImgixSettingActionGroup">
<annotations>
<description>Goes to the 'Configuration' page for 'Imgix'. Save Values to the 'Settings' section.</description>
</annotations>
<arguments>
<argument name="enabled" type="string" defaultValue="{{AdminEnableImgixModule.value}}"/>
<argument name="imgix_api_key" type="string" defaultValue="{{AdminSetImgixAPIKey.value}}"/>
<argument name="default_options" type="string" defaultValue="{{AdminSetDefaultImageOptions.value}}"/>
<argument name="small_options" type="string" defaultValue="{{AdminAddImgixSmallImageOptions.value}}"/>
<argument name="thumbnail_options" type="string" defaultValue="{{AdminAddImgixThumbnailImageOptions.value}}"/>
</arguments>
<amOnPage url="{{ImgixConfigurationPage.url}}" stepKey="navigateToImgixConfigurationPage"/>
<waitForPageLoad stepKey="waitForPageLoad"/>
<selectOption selector="{{SettingSection.enabled}}" userInput="{{enabled}}" stepKey="selectImgixModuleEnabled"/>
<fillField selector="{{SettingSection.imgixApiKey}}" userInput="{{imgix_api_key}}" stepKey="fillImgixApiKey"/>
<fillField selector="{{SettingSection.defaultOptions}}" userInput="{{default_options}}" stepKey="fillDefaultOptions"/>
<fillField selector="{{SettingSection.smallOptions}}" userInput="{{small_options}}" stepKey="fillSmallOptions"/>
<fillField selector="{{SettingSection.thumbnailOptions}}" userInput="{{thumbnail_options}}" stepKey="fillThumbnailOptions"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="NavigateToDefaultLayoutsImgixSettingResetActionGroup">
<annotations>
<description>Goes to the 'Configuration' page for 'Imgix'. Reset Values to the 'Settings' section.</description>
</annotations>
<arguments>
<argument name="disabled_imgix" type="string" defaultValue="{{AdminDisableImgixModule.value}}"/>
<argument name="reset_imgix_api_key" type="string" defaultValue="{{AdminResetImgixAPIKey.value}}"/>
</arguments>
<amOnPage url="{{ImgixConfigurationPage.url}}" stepKey="navigateToImgixConfigurationPage"/>
<waitForPageLoad stepKey="waitForPageLoad"/>
<selectOption selector="{{SettingSection.enabled}}" userInput="{{disabled_imgix}}" stepKey="selectImgixModuleEnabled"/>
<fillField selector="{{SettingSection.imgixApiKey}}" userInput="{{reset_imgix_api_key}}" stepKey="fillImgixApiKey"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="NavigateToDefaultLayoutsImgixSettingWrongAPIKeyActionGroup">
<annotations>
<description>Save incorrect `imgix API` key value to the system configuration `imgix Settings` section.</description>
</annotations>
<arguments>
<argument name="enabled" type="string" defaultValue="{{AdminEnableImgixModule.value}}"/>
<argument name="wrong_imgix_api_key" type="string" defaultValue="{{AdminSetWrongImgixAPIKey.value}}"/>
<argument name="default_options" type="string" defaultValue="{{AdminSetDefaultImageOptions.value}}"/>
<argument name="small_options" type="string" defaultValue="{{AdminAddImgixSmallImageOptions.value}}"/>
<argument name="thumbnail_options" type="string" defaultValue="{{AdminAddImgixThumbnailImageOptions.value}}"/>
</arguments>
<amOnPage url="{{ImgixConfigurationPage.url}}" stepKey="navigateToImgixConfigurationPage"/>
<waitForPageLoad stepKey="waitForPageLoad"/>
<selectOption selector="{{SettingSection.enabled}}" userInput="{{enabled}}" stepKey="selectImgixModuleEnabled"/>
<fillField selector="{{SettingSection.imgixApiKey}}" userInput="{{wrong_imgix_api_key}}" stepKey="fillImgixApiKey"/>
<fillField selector="{{SettingSection.defaultOptions}}" userInput="{{default_options}}" stepKey="fillDefaultOptions"/>
<fillField selector="{{SettingSection.smallOptions}}" userInput="{{small_options}}" stepKey="fillSmallOptions"/>
<fillField selector="{{SettingSection.thumbnailOptions}}" userInput="{{thumbnail_options}}" stepKey="fillThumbnailOptions"/>
</actionGroup>
</actionGroups>
Loading