Skip to content

Commit 247c1be

Browse files
committed
refactoring the test
1 parent 39012d4 commit 247c1be

File tree

3 files changed

+76
-16
lines changed

3 files changed

+76
-16
lines changed
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="StorefrontAssertCategoryNameIsShownInMenuActionGroup">
12+
<annotations>
13+
<description>Validate that the Category is present in menu on Frontend.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="categoryName" type="string"/>
17+
</arguments>
18+
19+
<seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(categoryName)}}"
20+
stepKey="seeCatergoryInStoreFront"/>
21+
</actionGroup>
22+
</actionGroups>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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="StorefrontSwitchStoreActionGroup">
12+
<annotations>
13+
<description>Switch the Storefront to the provided Store.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="storeName" type="string"/>
17+
</arguments>
18+
<click selector="{{StorefrontFooterSection.switchStoreButton}}" stepKey="clickOnSwitchStoreButton"/>
19+
<click selector="{{StorefrontFooterSection.storeLink(storeName)}}" stepKey="selectStoreToSwitchOn"/>
20+
</actionGroup>
21+
</actionGroups>

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

Lines changed: 33 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,22 @@
3232
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
3333
</after>
3434

35-
<!--Open Store Page -->
36-
<amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/>
37-
<waitForPageLoad stepKey="waitForSystemStorePage"/>
35+
<!--&lt;!&ndash;Open Store Page &ndash;&gt;-->
36+
<!--<amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/>-->
37+
<!--<waitForPageLoad stepKey="waitForSystemStorePage"/>-->
3838

39-
<!--Create Custom Store -->
40-
<click selector="{{AdminStoresMainActionsSection.createStoreButton}}" stepKey="selectCreateStore"/>
41-
<fillField userInput="{{customStore.name}}" selector="{{AdminNewStoreGroupSection.storeGrpNameTextField}}" stepKey="fillStoreName"/>
42-
<fillField userInput="{{customStore.code}}" selector="{{AdminNewStoreGroupSection.storeGrpCodeTextField}}" stepKey="fillStoreCode"/>
43-
<selectOption userInput="{{NewRootCategory.name}}" selector="{{AdminNewStoreGroupSection.storeRootCategoryDropdown}}" stepKey="selectStoreStatus"/>
44-
<click selector="{{AdminStoresMainActionsSection.saveButton}}" stepKey="clickSaveStoreButton"/>
39+
<!--&lt;!&ndash;Create Custom Store &ndash;&gt;-->
40+
<!--<click selector="{{AdminStoresMainActionsSection.createStoreButton}}" stepKey="selectCreateStore"/>-->
41+
<!--<fillField userInput="{{customStore.name}}" selector="{{AdminNewStoreGroupSection.storeGrpNameTextField}}" stepKey="fillStoreName"/>-->
42+
<!--<fillField userInput="{{customStore.code}}" selector="{{AdminNewStoreGroupSection.storeGrpCodeTextField}}" stepKey="fillStoreCode"/>-->
43+
<!--<selectOption userInput="{{NewRootCategory.name}}" selector="{{AdminNewStoreGroupSection.storeRootCategoryDropdown}}" stepKey="selectStoreStatus"/>-->
44+
<!--<click selector="{{AdminStoresMainActionsSection.saveButton}}" stepKey="clickSaveStoreButton"/>-->
45+
46+
<actionGroup ref="CreateCustomStoreActionGroup" stepKey="createCustomStore">
47+
<argument name="website" value="{{_defaultWebsite.name}}"/>
48+
<argument name="store" value="{{customStore.name}}"/>
49+
<argument name="rootCategory" value="$$rootCategory.name$$"/>
50+
</actionGroup>
4551

4652
<!--Create Store View-->
4753
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView">
@@ -50,13 +56,24 @@
5056
</actionGroup>
5157

5258
<!--Verify Category in Store View-->
53-
<amOnPage url="/{{NewRootCategory.name}}/{{SimpleRootSubCategory.name}}.html" stepKey="seeTheCategoryInStoreFront"/>
54-
<waitForPageLoad stepKey="waitForSystemStorePage1"/>
55-
<click selector="{{StorefrontFooterSection.switchStoreButton}}" stepKey="ClickSwitchStoreButtonOnDefaultStore"/>
56-
<click selector="{{StorefrontFooterSection.storeLink(customStore.name)}}" stepKey="SelectSecondStoreToSwitchOn"/>
57-
<seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(SimpleRootSubCategory.name)}}" stepKey="seeCatergoryInStoreFront"/>
58-
<click selector="{{StorefrontHeaderSection.NavigationCategoryByName(SimpleRootSubCategory.name)}}" stepKey="selectCategory"/>
59-
<waitForPageLoad stepKey="waitForProductToLoad"/>
59+
<!--<amOnPage url="/{{NewRootCategory.name}}/{{SimpleRootSubCategory.name}}.html" stepKey="seeTheCategoryInStoreFront"/>-->
60+
<!--<waitForPageLoad stepKey="waitForSystemStorePage1"/>-->
61+
<!--<click selector="{{StorefrontFooterSection.switchStoreButton}}" stepKey="ClickSwitchStoreButtonOnDefaultStore"/>-->
62+
<!--<click selector="{{StorefrontFooterSection.storeLink(customStore.name)}}" stepKey="SelectSecondStoreToSwitchOn"/>-->
63+
<!--<seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(SimpleRootSubCategory.name)}}" stepKey="seeCatergoryInStoreFront"/>-->
64+
<!--<click selector="{{StorefrontHeaderSection.NavigationCategoryByName(SimpleRootSubCategory.name)}}" stepKey="selectCategory"/>-->
65+
<!--<waitForPageLoad stepKey="waitForProductToLoad"/>-->
66+
67+
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomepage"/>
68+
<actionGroup ref="StorefrontSwitchStoreActionGroup" stepKey="switchCustomStore">
69+
<argument name="storeName" value="{{customStore.name}}"/>
70+
</actionGroup>
71+
<actionGroup ref="StorefrontAssertCategoryNameIsShownInMenuActionGroup" stepKey="seeCatergoryInStoreFront">
72+
<argument name="categoryName" value="{{SimpleRootSubCategory.name}}"/>
73+
</actionGroup>
74+
<actionGroup ref="StorefrontGoToCategoryPageActionGroup" stepKey="selectCategory">
75+
<argument name="categoryName" value="$$category.name$$"/>
76+
</actionGroup>
6077

6178
<!--Update URL Key-->
6279
<actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="openAdminCategoryIndexPage"/>

0 commit comments

Comments
 (0)