Skip to content

Commit

Permalink
Working on the test
Browse files Browse the repository at this point in the history
  • Loading branch information
kate-kyzyma committed Sep 15, 2020
1 parent 17ef4a7 commit 4d1cf82
Show file tree
Hide file tree
Showing 5 changed files with 133 additions and 74 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?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="AdminIncludeInMenuExcludedCategoryActionGroup.xml">
<annotations>
<description>Include to menu the excluded category</description>
</annotations>

<click selector="{{AdminCategoryBasicFieldSection.includeInMenuLabel}}" stepKey="includeToMenuCategory"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?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="AssertAdminCategoryIncludedToMenuActionGroup">
<annotations>
<description>Verify the category is included to menu</description>
</annotations>

<seeCheckboxIsChecked selector="{{AdminCategoryBasicFieldSection.IncludeInMenu}}" stepKey="seeCheckboxIncludeInMenuIsChecked"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?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="AssertAdminCategoryIsEnabledActionGroup">
<annotations>
<description>Verify the category is enabled</description>
</annotations>

<seeCheckboxIsChecked selector="{{AdminCategoryBasicFieldSection.EnableCategory}}" stepKey="seeCategoryIsEnabled"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?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="AssertAdminCategoryIsNotIncludeInMenuActionGroup">
<annotations>
<description>Verify the category is not included in menu</description>
</annotations>

<dontSeeCheckboxIsChecked selector="{{AdminCategoryBasicFieldSection.IncludeInMenu}}" stepKey="dontSeeCategoryIncludeInMenu"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -19,95 +19,82 @@
<group value="category"/>
</annotations>
<before>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/>

<!-- Create one category -->
<!-- Create a category -->
<createData entity="ApiCategory" stepKey="simpleCategory"/>
<!-- Create second category, having as parent the 1st one -->
<createData entity="SubCategoryWithParent" stepKey="simpleSubCategory">
<requiredEntity createDataKey="simpleCategory"/>
</createData>
</before>
<after>
<!--<actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="navigateToCategoryPage2"/>-->

<!--<click selector="{{AdminCategorySidebarTreeSection.categoryInTree(SimpleSubCategory.name)}}" stepKey="clickOnCreatedSimpleSubCategoryBeforeDelete"/>-->
<!--<actionGroup ref="DeleteCategoryActionGroup" stepKey="deleteCategory">-->
<!--<argument name="categoryEntity" value="SimpleSubCategory"/>-->
<!--</actionGroup>-->
<deleteData createDataKey="simpleSubCategory" stepKey="deleteSubCategory"/>
<deleteData createDataKey="simpleCategory" stepKey="deleteCategory"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
</after>
<!--<actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="navigateToCategoryPage"/>-->
<!--<scrollToTopOfPage stepKey="scrollToTopOfPage"/>-->

<!--&lt;!&ndash;Create new category under Default Category&ndash;&gt;-->
<!--<actionGroup ref="CreateCategoryActionGroup" stepKey="createSubcategory">-->
<!--<argument name="categoryEntity" value="SimpleSubCategory"/>-->
<!--</actionGroup>-->
<!--&lt;!&ndash;Create another subcategory under created category&ndash;&gt;-->
<!--<actionGroup ref="CreateCategoryActionGroup" stepKey="createSecondSubcategory">-->
<!--<argument name="categoryEntity" value="SubCategoryWithParent"/>-->
<!--</actionGroup>-->
<!--Go to storefront and verify visibility of categories-->
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToStorefrontPage"/>
<actionGroup ref="StorefrontAssertCategoryNameIsShownInMenuActionGroup" stepKey="seeCreatedCategoryOnStorefront">
<argument name="categoryName" value="$$simpleCategory.name$$"/>
</actionGroup>
<actionGroup ref="StorefrontAssertCategoryNameIsNotShownInMenuActionGroup" stepKey="doNotSeeSubCategoryOnStorefront">
<argument name="categoryName" value="$$simpleSubCategory.name$$"/>
</actionGroup>

<!--Set Include in menu to No on created category under Default Category -->
<actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/>
<actionGroup ref="NavigateToCreatedCategoryActionGroup" stepKey="openParentCategoryViaAdmin">
<argument name="Category" value="$$simpleCategory$$"/>
</actionGroup>
<actionGroup ref="AdminDisableIncludeInMenuConfigActionGroup" stepKey="setNoToIncludeInMenuSelect"/>
<actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveCategory"/>
<actionGroup ref="AssertAdminCategoryIsEnabledActionGroup" stepKey="assertParentCategoryIsActive"/>
<actionGroup ref="AssertAdminCategoryIsNotIncludeInMenuActionGroup" stepKey="assertParentCategoryIsNotIncludeInMenu"/>

<!--Go to storefront and verify visibility of categories-->
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToStorefrontPageSecondTime"/>
<actionGroup ref="StorefrontAssertCategoryNameIsNotShownInMenuActionGroup" stepKey="doNotSeeParentCategoryOnStorefront">
<argument name="categoryName" value="$$simpleCategory.name$$"/>
</actionGroup>
<actionGroup ref="StorefrontAssertCategoryNameIsNotShownInMenuActionGroup" stepKey="doNotSeeSubCategory">
<argument name="categoryName" value="$$simpleSubCategory.name$$"/>
</actionGroup>

<!--&lt;!&ndash;Go to storefront and verify visibility of categories&ndash;&gt;-->
<!--<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToStorefrontPage"/>-->
<!--&lt;!&ndash;<seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(SimpleSubCategory.name)}}" stepKey="seeSimpleSubCategoryOnStorefront1"/>&ndash;&gt;-->
<!--&lt;!&ndash;<dontSeeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(SubCategoryWithParent.name)}}" stepKey="dontSeeSubCategoryWithParentOnStorefront1"/>&ndash;&gt;-->
<!--<actionGroup ref="StorefrontAssertCategoryNameIsShownInMenuActionGroup" stepKey="seeMainCategoryOnStorefront">-->
<!--<argument name="categoryName" value="$$defaultCategory.name$$"/>-->
<!--</actionGroup>-->
<!--<actionGroup ref="StorefrontAssertCategoryNameIsNotShownInMenuActionGroup" stepKey="doNotSeeSubCategoryOnStorefront">-->
<!--<argument name="categoryName" value="$$subCategory.name$$"/>-->
<!--</actionGroup>-->
<!--Set Enable category to No and Include in menu to Yes on created category under Default Category -->
<actionGroup ref="NavigateToCreatedCategoryActionGroup" stepKey="openParentCategoryViaAdminSecondTime">
<argument name="Category" value="$$simpleCategory$$"/>
</actionGroup>
<actionGroup ref="AdminDisableActiveCategoryActionGroup" stepKey="SetNoToEnableCategorySelect"/>
<actionGroup ref="AdminIncludeInMenuExcludedCategoryActionGroup" stepKey="SetToYesIncludeInMenuSelect"/>
<actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveParentCategory"/>
<actionGroup ref="AssertAdminCategoryIsInactiveActionGroup" stepKey="seeCategoryIsDisabled"/>
<actionGroup ref="AssertAdminCategoryIncludedToMenuActionGroup" stepKey="seeCheckboxIncludeInMenuIsChecked"/>

<!--&lt;!&ndash;Set Include in menu to No on created category under Default Category &ndash;&gt;-->
<!--<actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="navigateToCategoryPage"/>-->
<!--&lt;!&ndash;<click selector="{{AdminCategorySidebarTreeSection.categoryInTree(SimpleSubCategory.name)}}" stepKey="clickOnCreatedSimpleSubCategory1"/>&ndash;&gt;-->
<!--&lt;!&ndash;<click selector="{{AdminCategoryBasicFieldSection.includeInMenuLabel}}" stepKey="setNoToIncludeInMenuSelect"/>&ndash;&gt;-->
<!--&lt;!&ndash;<click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="clickSaveButton1"/>&ndash;&gt;-->
<!--<actionGroup ref="NavigateToCreatedCategoryActionGroup" stepKey="navigateToParentCategory">-->
<!--<argument name="Category" value="$$defaultCategory$$"/>-->
<!--</actionGroup>-->
<!--<actionGroup ref="AdminDisableIncludeInMenuConfigActionGroup" stepKey="setNoToIncludeInMenuSelect"/>-->
<!--<actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveCategory"/>-->
<!--Go to storefront and verify visibility of categories-->
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToStorefrontPageThirdTime"/>
<actionGroup ref="StorefrontAssertCategoryNameIsNotShownInMenuActionGroup" stepKey="doNotSeeCategoryInMenuOnStorefront">
<argument name="categoryName" value="$$simpleCategory.name$$"/>
</actionGroup>
<actionGroup ref="StorefrontAssertCategoryNameIsNotShownInMenuActionGroup" stepKey="doNotSeeSubCategoryInMenuOnStorefront">
<argument name="categoryName" value="$$simpleSubCategory.name$$"/>
</actionGroup>

<!--<seeCheckboxIsChecked selector="{{AdminCategoryBasicFieldSection.EnableCategory}}" stepKey="seeCheckboxEnableCategoryIsChecked"/>-->
<!--<dontSeeCheckboxIsChecked selector="{{AdminCategoryBasicFieldSection.IncludeInMenu}}" stepKey="dontSeeCheckboxIncludeInMenuIsChecked"/>-->
<!--Set Enable category to No and Include in menu to No on created category under Default Category -->
<actionGroup ref="NavigateToCreatedCategoryActionGroup" stepKey="openParentCategoryViaAdminThirdTime">
<argument name="Category" value="$$simpleCategory$$"/>
</actionGroup>
<actionGroup ref="AdminDisableIncludeInMenuConfigActionGroup" stepKey="setNoToIncludeInMenuForParentCategory"/>
<actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveChanges"/>
<actionGroup ref="AssertAdminCategoryIsInactiveActionGroup" stepKey="assertCategoryIsDisabled"/>
<actionGroup ref="AssertAdminCategoryIsNotIncludeInMenuActionGroup" stepKey="assertParentCategoryIsNotIncludeToMenu"/>

<!--&lt;!&ndash;Go to storefront and verify visibility of categories&ndash;&gt;-->
<!--<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToStorefrontPageSecondTime"/>-->
<!--&lt;!&ndash;<dontSeeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(SimpleSubCategory.name)}}" stepKey="dontSeeSimpleSubCategoryOnStorefront1"/>&ndash;&gt;-->
<!--&lt;!&ndash;<dontSeeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(SubCategoryWithParent.name)}}" stepKey="dontSeeSubCategoryWithParentOnStorefront2"/>&ndash;&gt;-->
<!--<actionGroup ref="StorefrontAssertCategoryNameIsNotShownInMenuActionGroup" stepKey="doNotSeeParentCategoryOnStorefront">-->
<!--<argument name="categoryName" value="$$defaultCategory.name$$"/>-->
<!--</actionGroup>-->
<!--<actionGroup ref="StorefrontAssertCategoryNameIsNotShownInMenuActionGroup" stepKey="doNotSeeSubCategory">-->
<!--<argument name="categoryName" value="$$subCategory.name$$"/>-->
<!--</actionGroup>-->
<!--&lt;!&ndash;Set Enable category to No and Include in menu to Yes on created category under Default Category &ndash;&gt;-->
<!--<actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="navigateToCategoryPage3"/>-->
<!--<click selector="{{AdminCategorySidebarTreeSection.categoryInTree(SimpleSubCategory.name)}}" stepKey="clickOnCreatedSimpleSubCategory2"/>-->
<!--<click selector="{{AdminCategoryBasicFieldSection.enableCategoryLabel}}" stepKey="SetNoToEnableCategorySelect"/>-->
<!--<click selector="{{AdminCategoryBasicFieldSection.includeInMenuLabel}}" stepKey="SetYesToIncludeInMenuSelect"/>-->
<!--<click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="clickSaveButton2"/>-->
<!--<dontSeeCheckboxIsChecked selector="{{AdminCategoryBasicFieldSection.EnableCategory}}" stepKey="dontSeeCheckboxEnableCategoryIsChecked"/>-->
<!--<seeCheckboxIsChecked selector="{{AdminCategoryBasicFieldSection.IncludeInMenu}}" stepKey="seeCheckboxIncludeInMenuIsChecked"/>-->
<!--&lt;!&ndash;Go to storefront and verify visibility of categories&ndash;&gt;-->
<!--<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToStorefrontPage3"/>-->
<!--<dontSeeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(SimpleSubCategory.name)}}" stepKey="dontSeeSimpleSubCategoryOnStorefront2"/>-->
<!--<dontSeeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(SubCategoryWithParent.name)}}" stepKey="dontSeeSubCategoryWithParentOnStorefront3"/>-->
<!--&lt;!&ndash;Set Enable category to No and Include in menu to No on created category under Default Category &ndash;&gt;-->
<!--<actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="navigateToCategoryPage4"/>-->
<!--<click selector="{{AdminCategorySidebarTreeSection.categoryInTree(SimpleSubCategory.name)}}" stepKey="clickOnCreatedSimpleSubCategory3"/>-->
<!--<click selector="{{AdminCategoryBasicFieldSection.includeInMenuLabel}}" stepKey="setNoToIncludeInMenuSelect2"/>-->
<!--<click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="clickSaveButton3"/>-->
<!--<dontSeeCheckboxIsChecked selector="{{AdminCategoryBasicFieldSection.EnableCategory}}" stepKey="dontSeeCheckboxEnableCategoryIsChecked2"/>-->
<!--<dontSeeCheckboxIsChecked selector="{{AdminCategoryBasicFieldSection.IncludeInMenu}}" stepKey="dontSeeCheckboxIncludeInMenuIsChecked2"/>-->
<!--&lt;!&ndash;Go to storefront and verify visibility of categories&ndash;&gt;-->
<!--<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToStorefrontPage4"/>-->
<!--<dontSeeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(SimpleSubCategory.name)}}" stepKey="dontSeeSimpleSubCategoryOnStorefront3"/>-->
<!--<dontSeeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(SubCategoryWithParent.name)}}" stepKey="dontSeeSubCategoryWithParentOnStorefront4"/>-->
<!--Go to storefront and verify visibility of categories-->
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToStorefrontPageFourthTime"/>
<actionGroup ref="StorefrontAssertCategoryNameIsNotShownInMenuActionGroup" stepKey="doNotSeeCategoryOnStorefront">
<argument name="categoryName" value="$$simpleCategory.name$$"/>
</actionGroup>
<actionGroup ref="StorefrontAssertCategoryNameIsNotShownInMenuActionGroup" stepKey="doNotSeeSubCategoryInMenu">
<argument name="categoryName" value="$$simpleSubCategory.name$$"/>
</actionGroup>
</test>
</tests>

0 comments on commit 4d1cf82

Please sign in to comment.