Skip to content

Commit 277e19a

Browse files
committed
Merge branch '323-store-code-in-url-test' of github.com:rogyar/magento-functional-tests-migration into community-tests-migration-pr
2 parents 3ab1708 + 6dcd0e9 commit 277e19a

File tree

8 files changed

+128
-0
lines changed

8 files changed

+128
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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="AdminAssertDashboardPageIsVisibleActionGroup">
12+
<seeInCurrentUrl url="{{AdminDashboardPage.url}}" stepKey="seeDashboardUrl"/>
13+
<see userInput="Dashboard" selector="{{AdminHeaderSection.pageTitle}}" stepKey="seeDashboardTitle"/>
14+
</actionGroup>
15+
</actionGroups>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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="StorefrontDisableAddStoreCodeToUrls">
12+
<!-- Magento default value -->
13+
<data key="path">web/url/use_store</data>
14+
<data key="scope_id">0</data>
15+
<data key="label">No</data>
16+
<data key="value">0</data>
17+
</entity>
18+
<entity name="StorefrontEnableAddStoreCodeToUrls">
19+
<data key="path">web/url/use_store</data>
20+
<data key="scope_id">0</data>
21+
<data key="label">Yes</data>
22+
<data key="value">1</data>
23+
</entity>
24+
</entities>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="AdminUserLoginWithStoreCodeInUrlTest">
12+
<annotations>
13+
<features value="Backend"/>
14+
<title value="Admin panel should be accessible with Add Store Code to URL setting enabled"/>
15+
<description value="Admin panel should be accessible with Add Store Code to URL setting enabled"/>
16+
<group value="backend"/>
17+
<group value="mtf_migrated"/>
18+
</annotations>
19+
<before>
20+
<magentoCLI command="config:set {{StorefrontEnableAddStoreCodeToUrls.path}} {{StorefrontEnableAddStoreCodeToUrls.value}}" stepKey="addStoreCodeToUrlEnable"/>
21+
</before>
22+
<after>
23+
<magentoCLI command="config:set {{StorefrontDisableAddStoreCodeToUrls.path}} {{StorefrontDisableAddStoreCodeToUrls.value}}" stepKey="addStoreCodeToUrlDisable"/>
24+
</after>
25+
26+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
27+
<actionGroup ref="AdminAssertDashboardPageIsVisibleActionGroup" stepKey="seeDashboardPage"/>
28+
</test>
29+
</tests>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="StorefrontAssertStoreCodeInUrlActionGroup">
11+
<seeInCurrentUrl url="{{StorefrontHomePage.url}}{{_defaultStore.code}}" stepKey="seeStoreCodeInURL"/>
12+
</actionGroup>
13+
</actionGroups>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="StorefrontAddStoreCodeInUrlTest">
12+
<annotations>
13+
<features value="Backend"/>
14+
<title value="Store code should be added to storefront URL if the corresponding configuration is enabled"/>
15+
<description value="Store code should be added to storefront URL if the corresponding configuration is enabled"/>
16+
<group value="store"/>
17+
<group value="mtf_migrated"/>
18+
</annotations>
19+
<before>
20+
<magentoCLI command="config:set {{StorefrontEnableAddStoreCodeToUrls.path}} {{StorefrontEnableAddStoreCodeToUrls.value}}" stepKey="addStoreCodeToUrlEnable"/>
21+
</before>
22+
<after>
23+
<magentoCLI command="config:set {{StorefrontDisableAddStoreCodeToUrls.path}} {{StorefrontDisableAddStoreCodeToUrls.value}}" stepKey="addStoreCodeToUrlDisable"/>
24+
</after>
25+
26+
<actionGroup ref="StorefrontClickOnHeaderLogoActionGroup" stepKey="clickOnStorefrontHeaderLogo"/>
27+
<actionGroup ref="StorefrontAssertStoreCodeInUrlActionGroup" stepKey="seeStoreCodeInUrl"/>
28+
</test>
29+
</tests>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="StorefrontClickOnHeaderLogoActionGroup">
11+
<amOnPage url="{{StorefrontHomePage.url}}" stepKey="gotToHomePage"/>
12+
<waitForPageLoad stepKey="waitForHomePageLoaded1"/>
13+
<click selector="{{StorefrontHeaderSection.logoLink}}" stepKey="clickOnLogo"/>
14+
<waitForPageLoad stepKey="waitForHomePageLoaded2"/>
15+
</actionGroup>
16+
</actionGroups>

app/code/Magento/Theme/Test/Mftf/Section/StorefrontHeaderSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@
99
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1010
<section name="StorefrontHeaderSection">
1111
<element name="welcomeMessage" type="text" selector=".greet.welcome"/>
12+
<element name="logoLink" type="button" selector=".header .logo"/>
1213
</section>
1314
</sections>

dev/tests/functional/tests/app/Magento/Store/Test/TestCase/AccessAdminWithStoreCodeInUrlTest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<data name="configData" xsi:type="string">add_store_code_to_urls</data>
1212
<data name="user/dataset" xsi:type="string">default</data>
1313
<data name="storeCode" xsi:type="string">default</data>
14+
<data name="tag" xsi:type="string">mftf_migrated:yes</data>
1415
<constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogin" />
1516
<constraint name="Magento\Store\Test\Constraint\AssertStoreCodeInUrl" />
1617
</variation>

0 commit comments

Comments
 (0)