|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<!-- |
| 3 | +/** |
| 4 | + * Copyright 2024 Adobe |
| 5 | + * All Rights Reserved. |
| 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="AdminDateAttributeCalendarPositioningTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Catalog"/> |
| 14 | + <stories value="ACP2E-4060: Date Attribute in custom Attribute Group Fails to Show Datepicker in Admin"/> |
| 15 | + <title value="Date attribute calendar should appear in correct position when assigned to attribute group"/> |
| 16 | + <description value="Verify that date attributes assigned to custom attribute groups display the calendar widget in the correct position relative to the input field"/> |
| 17 | + <severity value="MAJOR"/> |
| 18 | + <testCaseId value="AC-15180"/> |
| 19 | + <group value="Catalog"/> |
| 20 | + </annotations> |
| 21 | + |
| 22 | + <before> |
| 23 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 24 | + |
| 25 | + <!-- Create a new date attribute --> |
| 26 | + <createData entity="dateProductAttribute" stepKey="attribute"/> |
| 27 | + |
| 28 | + <!-- Go to default attribute set edit page --> |
| 29 | + <amOnPage url="{{AdminProductAttributeSetEditPage.url}}/{{AddToDefaultSet.attributeSetId}}/" stepKey="onAttributeSetEdit"/> |
| 30 | + |
| 31 | + <!-- Assert created attribute in unassigned section --> |
| 32 | + <see userInput="$$attribute.attribute_code$$" selector="{{AdminProductAttributeSetEditSection.unassignedAttributesTree}}" stepKey="seeAttributeInUnassigned"/> |
| 33 | + |
| 34 | + <!-- Assign the date attribute to the new group --> |
| 35 | + <actionGroup ref="AssignAttributeToGroupActionGroup" stepKey="assignAttributeToGroup"> |
| 36 | + <argument name="group" value="Design"/> |
| 37 | + <argument name="attribute" value="$$attribute.attribute_code$$"/> |
| 38 | + </actionGroup> |
| 39 | + |
| 40 | + <actionGroup ref="SaveAttributeSetActionGroup" stepKey="saveAttributeSet"/> |
| 41 | + |
| 42 | + <!-- Create a simple product for testing --> |
| 43 | + <createData entity="SimpleProduct" stepKey="createSimpleProduct"/> |
| 44 | + </before> |
| 45 | + |
| 46 | + <after> |
| 47 | + <deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> |
| 48 | + <deleteData createDataKey="attribute" stepKey="deleteAttribute"/> |
| 49 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 50 | + </after> |
| 51 | + |
| 52 | + <!-- Navigate to the product edit page --> |
| 53 | + <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndex"/> |
| 54 | + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridBySku"> |
| 55 | + <argument name="product" value="$$createSimpleProduct$$"/> |
| 56 | + </actionGroup> |
| 57 | + <click selector="{{AdminProductGridSection.productRowBySku($$createSimpleProduct.sku$$)}}" stepKey="openProduct"/> |
| 58 | + <waitForPageLoad stepKey="waitForProductToLoad"/> |
| 59 | + |
| 60 | + <!-- Verify the date attribute is visible in the custom group --> |
| 61 | + <conditionalClick selector="{{AdminProductGridSection.productCollapsibleColumns('closed','Design')}}" dependentSelector="{{AdminProductGridSection.productCollapsibleColumns('closed','Design')}}" visible="true" stepKey="expandDesign"/> |
| 62 | + |
| 63 | + <!-- Click on the date input field to trigger the calendar --> |
| 64 | + <click selector="{{AdminProductFormSection.datePickerCalendar('1')}}" stepKey="clickDatePickerTrigger"/> |
| 65 | + |
| 66 | + <!-- Assert that the calendar is fully visible on screen --> |
| 67 | + <actionGroup ref="AssertElementVisibleOnScreenActionGroup" stepKey="assertCalendarVisibleOnScreen"> |
| 68 | + <argument name="selector" value=".ui-datepicker"/> |
| 69 | + </actionGroup> |
| 70 | + </test> |
| 71 | +</tests> |
0 commit comments