Skip to content

Commit 030b0a0

Browse files
committed
Merge remote-tracking branch 'origin/MC-7293' into 2.2-develop-mftf-pr17
# Conflicts: # app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductActionGroup.xml
2 parents a409ef7 + dd2ea10 commit 030b0a0

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

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

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
<arguments>
3636
<argument name="product" defaultValue="_defaultProduct"/>
3737
</arguments>
38+
<scrollToTopOfPage stepKey="scrollToTopOfPage"/>
3839
<fillField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="fillProductName"/>
3940
<fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" stepKey="fillProductSku"/>
4041
<fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{product.price}}" stepKey="fillProductPrice"/>
@@ -297,4 +298,36 @@
297298
<remove keyForRemoval="fillLongDescription"/>
298299
<fillField selector="{{AdminProductContentSection.shortDescriptionTextArea}}" userInput="{{description}}" stepKey="fillShortDescription"/>
299300
</actionGroup>
301+
302+
<!-- This action group simply navigates to the product catalog page -->
303+
<actionGroup name="AdminGoToProductCatalogPage">
304+
<comment userInput="actionGroup:GoToProductCatalogPage" stepKey="actionGroupComment"/>
305+
<amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="goToCatalogProductPage"/>
306+
<waitForPageLoad stepKey="waitForPageToLoad"/>
307+
</actionGroup>
308+
309+
<!-- You are on product Edit Page -->
310+
<!-- Assert checkbox available for website in Product In Websites -->
311+
<actionGroup name="AdminAssertWebsiteIsAvailableInProductWebsites">
312+
<arguments>
313+
<argument name="website" type="string"/>
314+
</arguments>
315+
<scrollTo selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="scrollToProductInWebsitesSection"/>
316+
<conditionalClick selector="{{ProductInWebsitesSection.sectionHeader}}" dependentSelector="{{ProductInWebsitesSection.sectionHeaderOpened}}" visible="false" stepKey="expandProductWebsitesSection"/>
317+
<seeElement selector="{{ProductInWebsitesSection.website(website)}}" stepKey="seeCheckboxForWebsite"/>
318+
</actionGroup>
319+
320+
<!-- You are on product Edit Page -->
321+
<!-- Assert checkbox not available for website in Product In Websites -->
322+
<actionGroup name="AdminAssertWebsiteIsNotAvailableInProductWebsites" extends="AdminAssertWebsiteIsAvailableInProductWebsites">
323+
<remove keyForRemoval="seeCheckboxForWebsite"/>
324+
<dontSeeElement selector="{{ProductInWebsitesSection.website(website)}}" after="expandProductWebsitesSection" stepKey="dontSeeCheckboxForWebsite"/>
325+
</actionGroup>
326+
327+
<!-- You are on product Edit Page -->
328+
<!-- Assert checkbox Is checked for website in Product In Websites -->
329+
<actionGroup name="AdminAssertProductIsAssignedToWebsite" extends="AdminAssertWebsiteIsAvailableInProductWebsites">
330+
<remove keyForRemoval="seeCheckboxForWebsite"/>
331+
<seeCheckboxIsChecked selector="{{ProductInWebsitesSection.website(website)}}" after="expandProductWebsitesSection" stepKey="seeCustomWebsiteIsChecked"/>
332+
</actionGroup>
300333
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
</section>
5454
<section name="ProductInWebsitesSection">
5555
<element name="sectionHeader" type="button" selector="div[data-index='websites']" timeout="30"/>
56+
<element name="sectionHeaderOpened" type="button" selector="[data-index='websites']._show" timeout="30"/>
5657
<element name="website" type="checkbox" selector="//label[contains(text(), '{{var1}}')]/parent::div//input[@type='checkbox']" parameterized="true"/>
5758
<element name="isWebsiteDisabled" type="checkbox" selector="//label[contains(text(), '{{websiteName}}')]/parent::div//input[@type='checkbox' and @disabled]" parameterized="true"/>
5859
</section>

0 commit comments

Comments
 (0)