Skip to content

Commit 6a7484e

Browse files
authored
Merge pull request #4780 from magento-tsg/2.2-develop-pr108
[TSG] Fixes for 2.2 (pr108) (2.2-develop)
2 parents 3a5185a + 80ccd9f commit 6a7484e

File tree

35 files changed

+790
-191
lines changed

35 files changed

+790
-191
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminClickSaveAndContinueButtonActionGroup">
12+
<annotations>
13+
<description>Click "Save and Continue" button and assert message</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="message" type="string"/>
17+
</arguments>
18+
<scrollToTopOfPage stepKey="scrollToPageTop"/>
19+
<click selector="{{AdminMainActionsSection.saveAndContinue}}" stepKey="clickSaveAndContinue"/>
20+
<waitForElementVisible time="30" selector="{{AdminMessagesSection.success}}" stepKey="waitMessage"/>
21+
<see selector="{{AdminMessagesSection.success}}" userInput="{{message}}" stepKey="verifyMessage"/>
22+
</actionGroup>
23+
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductActionGroup.xml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,15 @@
6060

6161
<!--Save product and see success message-->
6262
<actionGroup name="saveProductForm">
63-
<scrollToTopOfPage stepKey="scrollToTop"/>
63+
<annotations>
64+
<description>Clicks on the Save button. Validates that the Success Message is present and correct.</description>
65+
</annotations>
66+
67+
<scrollToTopOfPage stepKey="scrollTopPageProduct"/>
68+
<waitForElementVisible selector="{{AdminProductFormActionSection.saveButton}}" stepKey="waitForSaveProductButton"/>
6469
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveProduct"/>
65-
<see selector="{{AdminProductMessagesSection.successMessage}}" userInput="You saved the product." stepKey="seeSaveConfirmation"/>
70+
<waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitProductSaveSuccessMessage"/>
71+
<see selector="{{AdminMessagesSection.success}}" userInput="You saved the product." stepKey="seeSaveConfirmation"/>
6672
</actionGroup>
6773

6874
<!--Upload image for product-->

app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@
2020
<arguments>
2121
<argument name="useForPromoRule" type="string" defaultValue="Yes"/>
2222
</arguments>
23-
<click selector="{{StorefrontPropertiesSection.storefrontPropertiesTab}}" stepKey="clickStoreFrontPropertiesTab"/>
24-
<selectOption selector="{{StorefrontPropertiesSection.useForPromoRuleConditions}}" userInput="{{useForPromoRule}}" stepKey="changeOption"/>
23+
<click selector="{{AdminEditAttributeStorefrontPropertiesSection.storeFrontPropertiesTab}}" stepKey="clickStoreFrontPropertiesTab"/>
24+
<waitForElementVisible selector="{{AdminEditAttributeStorefrontPropertiesSection.useForPromoRuleConditions}}" stepKey="waitForUseForPromoRuleConditionsVisible"/>
25+
<selectOption selector="{{AdminEditAttributeStorefrontPropertiesSection.useForPromoRuleConditions}}" userInput="{{useForPromoRule}}" stepKey="changeOption"/>
2526
<click selector="{{AttributePropertiesSection.save}}" stepKey="saveAttribute"/>
27+
<waitForElementVisible selector="{{AdminMessagesSection.successMessage}}" stepKey="waitForSuccessMessage"/>
2628
<see selector="{{AdminMessagesSection.successMessage}}" userInput="You saved the product attribute." stepKey="successMessage"/>
2729
</actionGroup>
2830
<actionGroup name="navigateToProductAttributeByCode">

app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCategoryActionGroup.xml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,11 @@
3434
<seeElement selector="{{StorefrontCategoryProductSection.productTitleByName(product.name)}}" stepKey="assertProductName"/>
3535
<see userInput="${{product.price}}.00" selector="{{StorefrontCategoryProductSection.ProductPriceByName(product.name)}}" stepKey="AssertProductPrice"/>
3636
<moveMouseOver selector="{{StorefrontCategoryProductSection.ProductInfoByName(product.name)}}" stepKey="moveMouseOverProduct" />
37-
<executeInSelenium function="function($webdriver) use ($I) {
37+
<!-- @TODO: This causes a parsing error after updating the magento-testing-framework to version 2.4.4 -->
38+
<!--<executeInSelenium function="function($webdriver) use ($I) {
3839
$productName = '//main//li[.//a[contains(text(), \'' . {{product.name}} . '\' )]]//div[@data-container=\'product-grid\']';
3940
$I->assertEquals('2', $webdriver->findElement(\Facebook\WebDriver\WebDriverBy::xpath($productName))->getCSSValue('z-index'));
40-
}" stepKey="assertProductContainerIsOpened"/>
41+
}" stepKey="assertProductContainerIsOpened"/>-->
4142
<seeElement selector="{{StorefrontCategoryProductSection.productAddToCartByName(product.name)}}" stepKey="assertAddToCart" />
4243
</actionGroup>
4344

@@ -60,6 +61,7 @@
6061
</arguments>
6162
<!-- Go to storefront category page -->
6263
<amOnPage url="{{StorefrontCategoryPage.url(category)}}?product_list_mode={{mode}}&amp;product_list_order={{sortBy}}&amp;product_list_dir={{sort}}" stepKey="onCategoryPage"/>
64+
<waitForPageLoad time="30" stepKey="waitCategoryPageLoaded"/>
6365
</actionGroup>
6466

6567
<actionGroup name="VerifyCategoryPageParameters">
@@ -69,7 +71,6 @@
6971
<argument name="numOfProductsPerPage" type="string"/>
7072
<argument name="sortBy" type="string" defaultValue="position"/>
7173
</arguments>
72-
<amOnPage url="{{StorefrontCategoryPage.url(categoryName)}}" stepKey="navigateToCategoryPage"/>
7374
<seeInTitle userInput="{{categoryName}}" stepKey="assertCategoryNameInTitle"/>
7475
<see userInput="{{categoryName}}" selector="{{StorefrontCategoryMainSection.categoryTitle}}" stepKey="assertCategoryName"/>
7576
<see userInput="{{mode}}" selector="{{StorefrontCategoryPagerSection.modeGridIsActive}}" stepKey="assertViewMode"/>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
-->
7+
8+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
9+
<actionGroup name="StorefrontNavigateCategoryPageActionGroup">
10+
<annotations>
11+
<description>Navigates storefront category page by url key</description>
12+
</annotations>
13+
<arguments>
14+
<argument name="categoryUrlKey"/>
15+
</arguments>
16+
<amOnPage url="{{StorefrontCategoryPage.url(categoryUrlKey)}}" stepKey="navigateStorefrontCategoryPage"/>
17+
<waitForPageLoad time="30" stepKey="waitCategoryPageLoaded"/>
18+
</actionGroup>
19+
</actionGroups>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
11+
<entity name="DefaultCategoryProductLink" type="CategoryProductLink">
12+
<var key="sku" entityKey="sku" entityType="product"/>
13+
<var key="category_id" entityKey="id" entityType="category"/>
14+
</entity>
15+
<entity name="CustomCategoryProductLink" type="CategoryProductLink">
16+
<var key="sku" entityKey="sku" entityType="product2"/>
17+
<var key="category_id" entityKey="id" entityType="category"/>
18+
</entity>
19+
</entities>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataOperation.xsd">
10+
<operation name="CreateCatalogCategoryProductLink" dataType="CategoryProductLink"
11+
type="create"
12+
auth="adminOauth"
13+
url="/V1/categories/{categoryId}/products"
14+
method="POST">
15+
<contentType>application/json</contentType>
16+
<object key="productLink" dataType="CategoryProductLink">
17+
<field key="sku">string</field>
18+
<field key="position">integer</field>
19+
<field key="category_id">string</field>
20+
</object>
21+
</operation>
22+
</operations>

app/code/Magento/Catalog/Test/Mftf/Test/StorefrontRememberCategoryPaginationTest.xml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
</createData>
3131

3232
<createData entity="RememberPaginationCatalogStorefrontConfig" stepKey="setRememberPaginationCatalogStorefrontConfig"/>
33-
<magentoCLI command="cache:flush" stepKey="clearCache"/>
3433
</before>
3534

3635
<after>
@@ -40,26 +39,29 @@
4039
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
4140
<deleteData createDataKey="createProduct1" stepKey="deleteProduct1"/>
4241
<deleteData createDataKey="createCategory1" stepKey="deleteCategory1"/>
43-
44-
<magentoCLI command="cache:flush" stepKey="flushCache"/>
4542
</after>
4643

47-
<actionGroup ref="GoToStorefrontCategoryPageByParameters" stepKey="goToStorefrontCategory1Page">
48-
<argument name="category" value="$$createCategory.name$$"/>
44+
<actionGroup ref="GoToStorefrontCategoryPageByParameters" stepKey="goToStorefrontCategoryPage">
45+
<argument name="category" value="$$createCategory.custom_attributes[url_key]$$"/>
4946
<argument name="mode" value="grid"/>
5047
</actionGroup>
5148

5249
<selectOption selector="{{StorefrontCategoryPagerSection.perPage}}" userInput="12" stepKey="setPerPage" />
53-
<waitForPageLoad stepKey="waitForPageLoad"/>
50+
<waitForPageLoad time="30" stepKey="waitForPageLoad"/>
51+
52+
<actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="navigateToCategoryPage">
53+
<argument name="categoryUrlKey" value="$$createCategory.custom_attributes[url_key]$$"/>
54+
</actionGroup>
5455

5556
<actionGroup ref="VerifyCategoryPageParameters" stepKey="verifyCategoryPageParameters">
5657
<argument name="categoryName" value="$$createCategory.name$$"/>
5758
<argument name="mode" value="grid"/>
5859
<argument name="numOfProductsPerPage" value="12"/>
5960
</actionGroup>
6061

61-
<amOnPage url="{{StorefrontCategoryPage.url($$createCategory1.name$$)}}" stepKey="navigateToCategory1Page"/>
62-
<waitForPageLoad stepKey="waitForCategory1PageToLoad"/>
62+
<actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="navigateToCategory1Page">
63+
<argument name="categoryUrlKey" value="$$createCategory1.custom_attributes[url_key]$$"/>
64+
</actionGroup>
6365

6466
<actionGroup ref="VerifyCategoryPageParameters" stepKey="verifyCategory1PageParameters">
6567
<argument name="categoryName" value="$$createCategory1.name$$"/>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminCatalogInventoryConfigurationMaxQtyAllowedInShoppingCartValidationActionGroup">
12+
<arguments>
13+
<argument name="qty" type="string"/>
14+
<argument name="errorMessage" type="string"/>
15+
</arguments>
16+
17+
<fillField selector="{{AdminInventoryProductStockOptionsConfigSection.maxSaleQty}}" userInput="{{qty}}" stepKey="setMaxSaleQtyValue"/>
18+
<click selector="{{AdminMainActionsSection.save}}" stepKey="clickSaveConfigButton"/>
19+
<waitForElementVisible selector="{{AdminInventoryProductStockOptionsConfigSection.maxSaleQtyError}}" stepKey="waitValidationErrorMessageAppears"/>
20+
<see selector="{{AdminInventoryProductStockOptionsConfigSection.maxSaleQtyError}}" userInput="{{errorMessage}}" stepKey="checkValidationErrorMessage"/>
21+
</actionGroup>
22+
</actionGroups>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminProductSetMaxQtyAllowedInShoppingCart">
12+
<arguments>
13+
<argument name="qty" type="string"/>
14+
</arguments>
15+
<conditionalClick selector="{{AdminProductFormSection.advancedInventoryLink}}" dependentSelector="{{AdminProductFormAdvancedInventorySection.advancedInventoryModal}}" visible="false" stepKey="clickOnAdvancedInventoryLinkIfNeeded"/>
16+
<waitForElementVisible selector="{{AdminProductFormAdvancedInventorySection.maxiQtyConfigSetting}}" stepKey="waitForAdvancedInventoryModalWindowOpen"/>
17+
<uncheckOption selector="{{AdminProductFormAdvancedInventorySection.maxiQtyConfigSetting}}" stepKey="uncheckMaxQtyCheckBox"/>
18+
<fillField selector="{{AdminProductFormAdvancedInventorySection.maxiQtyAllowedInCart}}" userInput="{{qty}}" stepKey="fillMaxAllowedQty"/>
19+
<click selector="{{AdminSlideOutDialogSection.doneButton}}" stepKey="clickDone"/>
20+
</actionGroup>
21+
22+
<actionGroup name="AdminProductMaxQtyAllowedInShoppingCartValidationActionGroup" extends="AdminProductSetMaxQtyAllowedInShoppingCart">
23+
<arguments>
24+
<argument name="qty" type="string"/>
25+
<argument name="errorMessage" type="string"/>
26+
</arguments>
27+
28+
<waitForElementVisible selector="{{AdminProductFormAdvancedInventorySection.maxiQtyAllowedInCartError}}" after="clickDone" stepKey="waitProductValidationErrorMessageAppears"/>
29+
<see selector="{{AdminProductFormAdvancedInventorySection.maxiQtyAllowedInCartError}}" userInput="{{errorMessage}}" after="waitProductValidationErrorMessageAppears" stepKey="checkProductValidationErrorMessage"/>
30+
</actionGroup>
31+
</actionGroups>

0 commit comments

Comments
 (0)