|
| 1 | +<?xml version="1.0"?> |
| 2 | +<!-- |
| 3 | +/** |
| 4 | + * Copyright © Magento, Inc. All rights reserved. |
| 5 | + * See COPYING.txt for license details. |
| 6 | + */ |
| 7 | +--> |
| 8 | +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 9 | + <test name="AdminCreateDatetimeProductAttributeTest"> |
| 10 | + <annotations> |
| 11 | + <features value="Catalog"/> |
| 12 | + <stories value="Datetime product attributes support"/> |
| 13 | + <title value="Datetime product attribute type is supported"/> |
| 14 | + <description value="Admin should be able to create datetime product attribute"/> |
| 15 | + <severity value="CRITICAL"/> |
| 16 | + <testCaseId value="MC-21451"/> |
| 17 | + <group value="Catalog"/> |
| 18 | + </annotations> |
| 19 | + <before> |
| 20 | + <actionGroup ref="LoginAsAdmin" stepKey="login"/> |
| 21 | + </before> |
| 22 | + <after> |
| 23 | + <actionGroup ref="deleteProductAttribute" stepKey="deleteAttribute"> |
| 24 | + <argument name="ProductAttribute" value="datetimeProductAttribute"/> |
| 25 | + </actionGroup> |
| 26 | + <actionGroup ref="logout" stepKey="logout"/> |
| 27 | + </after> |
| 28 | + |
| 29 | + <amOnPage url="{{ProductAttributePage.url}}" stepKey="navigateToNewProductAttributePage"/> |
| 30 | + <waitForPageLoad stepKey="waitForPageLoad"/> |
| 31 | + <!-- Set attribute properties --> |
| 32 | + <fillField selector="{{AttributePropertiesSection.DefaultLabel}}" |
| 33 | + userInput="{{ProductAttributeFrontendLabel.label}}" stepKey="fillDefaultLabel"/> |
| 34 | + <selectOption selector="{{AttributePropertiesSection.InputType}}" |
| 35 | + userInput="{{datetimeProductAttribute.frontend_input}}" stepKey="fillInputType"/> |
| 36 | + <actionGroup ref="AdminNavigateToProductAttributeAdvancedSection" stepKey="goToAdvancedSectionNew"/> |
| 37 | + <fillField selector="{{AdvancedAttributePropertiesSection.AttributeCode}}" |
| 38 | + userInput="{{datetimeProductAttribute.attribute_code}}" |
| 39 | + stepKey="fillAttributeCode"/> |
| 40 | + <!-- Generate and set a default value --> |
| 41 | + <generateDate date="now" format="m/j/y g:i A" stepKey="generateDefaultValue"/> |
| 42 | + <fillField selector="{{AdvancedAttributePropertiesSection.DefaultValueDatetime}}" |
| 43 | + userInput="{$generateDefaultValue}" |
| 44 | + stepKey="fillDefaultValue"/> |
| 45 | + <!-- Save the new product attribute --> |
| 46 | + <click selector="{{AttributePropertiesSection.Save}}" stepKey="clickSaveAttribute"/> |
| 47 | + <waitForPageLoad stepKey="waitForGridPageLoadAfterSaveAttribute"/> |
| 48 | + <seeElement selector="{{AdminProductMessagesSection.successMessage}}" |
| 49 | + stepKey="waitForSuccessMessage"/> |
| 50 | + <!-- Navigate to created product attribute --> |
| 51 | + <actionGroup ref="navigateToCreatedProductAttribute" stepKey="navigateToAttribute"> |
| 52 | + <argument name="ProductAttribute" value="datetimeProductAttribute"/> |
| 53 | + </actionGroup> |
| 54 | + <!-- Check the saved date and time default value --> |
| 55 | + <actionGroup ref="AdminNavigateToProductAttributeAdvancedSection" stepKey="goToAdvancedSection"/> |
| 56 | + <scrollTo selector="{{AdvancedAttributePropertiesSection.DefaultValueDatetime}}" stepKey="scrollToDefaultValue"/> |
| 57 | + <seeInField userInput="{$generateDefaultValue}" |
| 58 | + selector="{{AdvancedAttributePropertiesSection.DefaultValueDatetime}}" |
| 59 | + stepKey="checkDefaultValue"/> |
| 60 | + </test> |
| 61 | +</tests> |
0 commit comments