|
| 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$$<script>alert('Hello')</script>" 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=""Email" is not a valid hostname. 'example.com<script>alert('Hello')</script>' looks like a DNS hostname but we cannot match it against the hostname schema for TLD 'com<script>alert('Hello')</script>'. 'example.com<script>alert('Hello')</script>' does not look like a valid local network name." stepKey="seeValidationErrorMessage"/> |
| 60 | + </test> |
| 61 | +</tests> |
0 commit comments