|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<!-- |
| 3 | +/** |
| 4 | + * Copyright 2025 Adobe |
| 5 | + * All Rights Reserved. |
| 6 | + */ |
| 7 | +--> |
| 8 | +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 9 | + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 10 | + <test name="AdminVerifyTaxRateStateResetWhenChangingCountryTest"> |
| 11 | + <annotations> |
| 12 | + <features value="Tax"/> |
| 13 | + <stories value="Tax Rate Administration"/> |
| 14 | + <title value="Tax rate state field should reset to asterisk when changing from US to UK"/> |
| 15 | + <description value="Verify state field resets to wildcard when changing country from US to UK in tax rate form"/> |
| 16 | + <severity value="MAJOR"/> |
| 17 | + <testCaseId value="AC-15440"/> |
| 18 | + <group value="tax"/> |
| 19 | + </annotations> |
| 20 | + <before> |
| 21 | + <!-- Step 1: Login to admin panel --> |
| 22 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 23 | + </before> |
| 24 | + <after> |
| 25 | + <!-- Logout from admin --> |
| 26 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> |
| 27 | + </after> |
| 28 | + <!-- Step 2: Navigate to Stores > Tax Rates --> |
| 29 | + <actionGroup ref="AdminTaxRateGridOpenPageActionGroup" stepKey="goToTaxRatesPage"/> |
| 30 | + <!-- Step 3: Click on "Add New Tax Rate" button --> |
| 31 | + <waitForElementClickable selector="{{AdminTaxRulesSection.addNewTaxRate}}" stepKey="waitToAddNewTaxRate"/> |
| 32 | + <click selector="{{AdminTaxRulesSection.addNewTaxRate}}" stepKey="addNewTaxRate"/> |
| 33 | + <!-- Step 4: Select State California (Country US is already selected by default) --> |
| 34 | + <seeOptionIsSelected selector="{{AdminTaxRateFormSection.country}}" userInput="{{US_Address_CA.country}}" stepKey="verifyUSIsDefaultCountry"/> |
| 35 | + <!-- Select California state --> |
| 36 | + <waitForElementVisible selector="{{AdminTaxRateFormSection.state}}" stepKey="waitForStateDropdownVisible"/> |
| 37 | + <selectOption selector="{{AdminTaxRateFormSection.state}}" userInput="{{US_Address_CA.state}}" stepKey="selectCaliforniaState"/> |
| 38 | + <waitForPageLoad stepKey="waitAfterSelectingCalifornia"/> |
| 39 | + <!-- Verify California is selected --> |
| 40 | + <seeOptionIsSelected selector="{{AdminTaxRateFormSection.state}}" userInput="{{US_Address_CA.state}}" stepKey="verifyCaliforniaIsSelected"/> |
| 41 | + <!-- Step 5: Switch Country to United Kingdom --> |
| 42 | + <selectOption selector="{{AdminTaxRateFormSection.country}}" userInput="{{UK_Address.country}}" stepKey="selectUnitedKingdom"/> |
| 43 | + <waitForPageLoad stepKey="waitAfterSelectingUK"/> |
| 44 | + <!-- Step 6 & 7: Verify state field shows asterisk (*) for countries without required states --> |
| 45 | + <!-- Verify state is NOT showing California anymore --> |
| 46 | + <dontSeeOptionIsSelected selector="{{AdminTaxRateFormSection.state}}" userInput="{{US_Address_CA.state}}" stepKey="verifyCaliforniaNotSelected"/> |
| 47 | + <!-- Verify state field shows asterisk (*) which represents "All States" --> |
| 48 | + <seeInField selector="{{AdminTaxRateFormSection.state}}" userInput="*" stepKey="verifyStateIsAsterisk"/> |
| 49 | + <!-- Alternative: Check if asterisk option is selected --> |
| 50 | + <seeOptionIsSelected selector="{{AdminTaxRateFormSection.state}}" userInput="*" stepKey="verifyAsteriskOptionSelected"/> |
| 51 | + </test> |
| 52 | +</tests> |
0 commit comments