Skip to content

Commit 2bf9158

Browse files
committed
Merge branch '2.3-tests-pr' of github.com:magento-pangolin/magento2ce into MC-6436
2 parents ea28e51 + b9dec14 commit 2bf9158

7 files changed

+110
-19
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="StorefrontOpenMyAccountPageActionGroup">
12+
<amOnPage url="{{StorefrontCustomerDashboardPage.url}}" stepKey="goToMyAccountPage"/>
13+
<waitForPageLoad stepKey="waitForPageLoad"/>
14+
</actionGroup>
15+
</actionGroups>

app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerAccountInformationSection.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,8 @@
2020
<element name="confirmNewPassword" type="input" selector="#password-confirmation"/>
2121
<element name="confirmNewPasswordError" type="text" selector="#password-confirmation-error"/>
2222
<element name="email" type="input" selector=".form-edit-account input[name='email']" />
23+
<element name="emailErrorMessage" type="text" selector="#email-error"/>
24+
<element name="currentPasswordErrorMessage" type="text" selector="#current-password-error"/>
25+
<element name="emailField" type="input" selector="#email"/>
2326
</section>
2427
</sections>

app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerAccountMainSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@
1111
<section name="StorefrontCustomerAccountMainSection">
1212
<element name="pageTitle" type="text" selector="#maincontent .column.main [data-ui-id='page-title-wrapper']" />
1313
<element name="messageByType" type="block" selector="#maincontent .message-{{messageType}}" parameterized="true" />
14+
<element name="alertMessage" type="text" selector=".page.messages [role=alert]"/>
1415
</section>
1516
</sections>

app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerDashboardAccountInformationSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<element name="ContactInformation" type="textarea" selector=".box.box-information .box-content"/>
1313
<element name="edit" type="block" selector=".action.edit" timeout="15"/>
1414
<element name="changePassword" type="block" selector=".action.change-password" timeout="15"/>
15+
<element name="editLink" type="text" selector=".box-information .edit"/>
1516
</section>
1617
<section name="StorefrontCustomerAddressSection">
1718
<element name="firstName" type="input" selector="#firstname"/>

app/code/Magento/LayeredNavigation/Test/Mftf/Section/LayeredNavigationSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="LayeredNavigationSection">
1212
<element name="layeredNavigation" type="select" selector="#catalog_layered_navigation-head"/>
13+
<element name="layeredNavigationBlock" type="block" selector="#catalog_layered_navigation"/>
1314
<element name="CheckIfTabExpand" type="button" selector="#catalog_layered_navigation-head:not(.open)"/>
1415
<element name="NavigationStepCalculation" type="button" selector="#catalog_layered_navigation_price_range_calculation"/>
1516
<element name="NavigationStepCalculationSystemValue" type="button" selector="#catalog_layered_navigation_price_range_calculation_inherit"/>

app/code/Magento/LayeredNavigation/Test/Mftf/Test/AdminSpecifyLayerNavigationConfigurationTest.xml

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,31 +15,40 @@
1515
<stories value="Magento_LayeredNavigation"/>
1616
<title value="Admin should be able to uncheck Default Value checkbox for dependent field"/>
1717
<description value="Admin should be able to uncheck Default Value checkbox for dependent field"/>
18-
<severity value="AVERAGE"/>
19-
<testCaseId value="MAGETWO-94872"/>
18+
<severity value="CRITICAL"/>
19+
<testCaseId value="MC-12604"/>
2020
</annotations>
21+
2122
<before>
2223
<actionGroup ref="LoginActionGroup" stepKey="login"/>
2324
</before>
24-
<amOnPage url="{{CatalogConfigPage.url}}" stepKey="navigateToConfigurationPage" />
25-
<waitForPageLoad stepKey="wait1"/>
26-
<conditionalClick stepKey="expandLayeredNavigationTab" selector="{{LayeredNavigationSection.layeredNavigation}}" dependentSelector="{{LayeredNavigationSection.CheckIfTabExpand}}" visible="true" />
27-
<waitForElementVisible selector="{{LayeredNavigationSection.NavigationStepCalculationSystemValue}}" stepKey="waitForUseSystemValueVisible"/>
28-
<uncheckOption selector="{{LayeredNavigationSection.NavigationStepCalculationSystemValue}}" stepKey="uncheckUseSystemValue"/>
29-
<selectOption selector="{{LayeredNavigationSection.NavigationStepCalculation}}" userInput="Manual" stepKey="selectOption1"/>
30-
<uncheckOption selector="{{LayeredNavigationSection.PriceNavigationStepSystemValue}}" stepKey="uncheckUseSystemValue2"/>
31-
<fillField selector="{{LayeredNavigationSection.PriceNavigationStep}}" userInput="102" stepKey="fillAdmin1"/>
32-
<click selector="{{ContentManagementSection.Save}}" stepKey="saveConfig" />
33-
<waitForPageLoad stepKey="waitForSavingSystemConfiguration"/>
34-
<waitForElementVisible selector="#catalog_layered_navigation" stepKey="waitForLayeredNav" />
35-
<scrollTo selector="#catalog_layered_navigation" x="0" y="-80" stepKey="scrollToLayeredNavigation" />
36-
<seeInField stepKey="seeThatValueWasSaved" selector="{{LayeredNavigationSection.PriceNavigationStep}}" userInput="102"/>
37-
<checkOption selector="{{LayeredNavigationSection.NavigationStepCalculationSystemValue}}" stepKey="setToDefaultValue1"/>
38-
<checkOption selector="{{LayeredNavigationSection.PriceNavigationStepSystemValue}}" stepKey="setToDefaultValue2"/>
39-
<click selector="{{ContentManagementSection.Save}}" stepKey="saveConfig2" />
40-
<waitForPageLoad stepKey="waitForSavingSystemConfiguration2"/>
25+
4126
<after>
4227
<actionGroup ref="logout" stepKey="logout"/>
4328
</after>
29+
30+
<!-- Configure Layered Navigation in Stores -> Configuration -> Catalog -> Layered Navigation -->
31+
<amOnPage url="{{CatalogConfigPage.url}}" stepKey="navigateToConfigurationPage"/>
32+
<waitForPageLoad stepKey="waitForPageLoad"/>
33+
<conditionalClick selector="{{LayeredNavigationSection.layeredNavigation}}" dependentSelector="{{LayeredNavigationSection.CheckIfTabExpand}}" visible="true" stepKey="expandLayeredNavigationTab"/>
34+
<waitForElementVisible selector="{{LayeredNavigationSection.NavigationStepCalculationSystemValue}}" stepKey="waitForUseSystemValueVisible"/>
35+
36+
<!-- Display Product Count = yes; Price Navigation Step Calculation = Manual; Default Price Navigation Step = 102 -->
37+
<uncheckOption selector="{{LayeredNavigationSection.NavigationStepCalculationSystemValue}}" stepKey="uncheckUseSystemValue"/>
38+
<selectOption selector="{{LayeredNavigationSection.NavigationStepCalculation}}" userInput="Manual" stepKey="selectOption"/>
39+
<uncheckOption selector="{{LayeredNavigationSection.PriceNavigationStepSystemValue}}" stepKey="uncheckUseStepSystemValue"/>
40+
<fillField selector="{{LayeredNavigationSection.PriceNavigationStep}}" userInput="102" stepKey="fillPriceNavStep"/>
41+
<click selector="{{ContentManagementSection.Save}}" stepKey="saveConfig" />
42+
<waitForPageLoad stepKey="waitForSavingSystemConfiguration"/>
43+
44+
<waitForElementVisible selector="{{LayeredNavigationSection.layeredNavigationBlock}}" stepKey="waitForLayeredNav"/>
45+
<scrollTo selector="{{LayeredNavigationSection.layeredNavigationBlock}}" x="0" y="-80" stepKey="scrollToLayeredNavigation"/>
46+
<seeInField userInput="102" selector="{{LayeredNavigationSection.PriceNavigationStep}}" stepKey="seeThatValueWasSaved"/>
47+
48+
<!-- It is possible uncheck Use Default checkbox -->
49+
<checkOption selector="{{LayeredNavigationSection.NavigationStepCalculationSystemValue}}" stepKey="setStepCalculationToDefaultValue"/>
50+
<checkOption selector="{{LayeredNavigationSection.PriceNavigationStepSystemValue}}" stepKey="setPriceNavToDefaultValue"/>
51+
<click selector="{{ContentManagementSection.Save}}" stepKey="saveConfiguration" />
52+
<waitForPageLoad stepKey="waitForSaveSystemConfiguration"/>
4453
</test>
4554
</tests>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
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="StorefrontCheckNecessaryLogicToActionClassForCookieMessagesTest">
12+
<annotations>
13+
<features value="Security"/>
14+
<stories value="Check necessary logic to action class for cookie messages"/>
15+
<title value="Storefront check necessary logic to action class for cookie messages test"/>
16+
<description value="Check necessary logic to action class for cookie messages"/>
17+
<testCaseId value="MC-6141" />
18+
<severity value="CRITICAL"/>
19+
<group value="security"/>
20+
<group value="customer"/>
21+
</annotations>
22+
<before>
23+
<!-- Create customer -->
24+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
25+
</before>
26+
<after>
27+
<!-- Delete customer -->
28+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
29+
</after>
30+
31+
<!-- Login to application -->
32+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount">
33+
<argument name="Customer" value="$$createCustomer$$"/>
34+
</actionGroup>
35+
36+
<!-- Open 'My Account' page and click 'Edit; link -->
37+
<actionGroup ref="StorefrontOpenMyAccountPageActionGroup" stepKey="goToMyAccountPage"/>
38+
<click selector="{{StorefrontCustomerDashboardAccountInformationSection.editLink}}" stepKey="clickEditContactInformation"/>
39+
40+
<!-- Mark as checked 'Change email' check-box. Assert 2 labels under 'Change Email' block -->
41+
<checkOption selector="{{StorefrontCustomerAccountInformationSection.changeEmail}}" stepKey="clickChangeEmailCheckbox"/>
42+
<seeElement selector="{{StorefrontCustomerAccountInformationSection.email}}" stepKey="seeEmailField"/>
43+
<seeElement selector="{{StorefrontCustomerAccountInformationSection.currentPassword}}" stepKey="seeCurrentPasswordField"/>
44+
45+
<!-- Change email attribute 'type' from email to text and type script after email address. Click 'Save' button -->
46+
<executeJS function="document.querySelector('{{StorefrontCustomerAccountInformationSection.emailField}}').setAttribute('type', 'text');" stepKey="changeAttributeFromEmailToText"/>
47+
<fillField selector="{{StorefrontCustomerAccountInformationSection.email}}" userInput="$$createCustomer.email$$&lt;script&gt;alert('Hello')&lt;/script&gt;" stepKey="fillEmailWithScript"/>
48+
<click selector="{{StorefrontCustomerAccountInformationSection.saveButton}}" stepKey="clickSave"/>
49+
50+
<!-- Assert error messages for email and password fields -->
51+
<dontSee selector="{{StorefrontCustomerAccountInformationSection.emailErrorMessage}}" userInput="Please enter a valid email address." stepKey="dontSeeEmailErrorMessage"/>
52+
<see selector="{{StorefrontCustomerAccountInformationSection.currentPasswordErrorMessage}}" userInput="This is a required field." stepKey="seeErrorPasswordMessage"/>
53+
54+
<!-- Fill password and click 'Save' button -->
55+
<fillField selector="{{StorefrontCustomerAccountInformationSection.currentPassword}}" userInput="$$createCustomer.password$$" stepKey="fillCurrentPassword"/>
56+
<click selector="{{StorefrontCustomerAccountInformationSection.saveButton}}" stepKey="saveChanges"/>
57+
58+
<!-- Throw validation error message (server side validation) with escaped customer input -->
59+
<see selector="{{StorefrontCustomerAccountMainSection.alertMessage}}" userInput="&quot;Email&quot; is not a valid hostname. 'example.com&lt;script&gt;alert('Hello')&lt;/script&gt;' looks like a DNS hostname but we cannot match it against the hostname schema for TLD 'com&lt;script&gt;alert('Hello')&lt;/script&gt;'. 'example.com&lt;script&gt;alert('Hello')&lt;/script&gt;' does not look like a valid local network name." stepKey="seeValidationErrorMessage"/>
60+
</test>
61+
</tests>

0 commit comments

Comments
 (0)