Skip to content

Commit 481991b

Browse files
committed
ACP2E-182: Error while validating Store VAT Number
1 parent 7be081e commit 481991b

File tree

1 file changed

+21
-29
lines changed

1 file changed

+21
-29
lines changed

app/code/Magento/Config/Test/Mftf/Test/CheckingVATNumberValidationButtonForEUCountryTest.xml

Lines changed: 21 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<severity value="CRITICAL"/>
1717
<testCaseId value="ACP2E-355"/>
1818
<useCaseId value="ACP2E-182"/>
19-
<stories value="Error while validating Store VAT Number"/>
19+
<stories value="Store VAT Number Validation"/>
2020
<group value="configuration"/>
2121
</annotations>
2222
<before>
@@ -30,44 +30,36 @@
3030
<actionGroup ref="AdminOpenStoreConfigPageActionGroup" stepKey="openStoreConfigPage"/>
3131

3232
<!-- Expand the store information tab -->
33-
<conditionalClick selector="{{StoreConfigSection.StoreInformation}}" dependentSelector="{{StoreConfigSection.CheckIfTabExpand}}" stepKey="checkIfTabOpen" visible="true"/>
34-
<waitForPageLoad time="60" stepKey="wait" />
33+
<conditionalClick selector="{{StoreConfigSection.StoreInformation}}" dependentSelector="{{StoreConfigSection.CheckIfTabExpand}}" visible="true" stepKey="checkIfTabOpen"/>
3534

36-
<!-- Verify that the page source contains the raw source code `<button class="action-validate-vat disabled">`. -->
37-
<seeInSource html="&#60;button class&#61;&#34;action-validate-vat disabled&#34;" stepKey="seeInSource"/>
38-
39-
<!--Open country options section and select an EU Country (`Denmark`) -->
40-
<selectOption userInput="{{DE_Address_Berlin_Not_Default_Address.country}}" selector="{{StoreConfigSection.Country}}" stepKey="selectEUStoreCountry"/>
41-
<waitForAjaxLoad stepKey="waitForAjaxLoad"/>
35+
<!-- Verify that `Validate VAT Number` button is available and visible on the current page. -->
36+
<seeElement selector="{{StoreConfigSection.validateVATNumber}}" stepKey="seeVATNumberButton"/>
4237

43-
<!-- Wait up to 30 seconds for `Validate VAT Number` button to become enabled on the page before continuing. -->
44-
<waitForElementVisible selector="{{StoreConfigSection.validateVATNumber}}" stepKey="waitForElementVisible"/>
38+
<!-- Verify that the `Validate VAT Number` button contains class `disabled` for non-EU Country or none-->
39+
<seeElement selector="{{StoreConfigSection.validateVATNumber}}" selectorArray="['class' => 'disabled']" stepKey="validateVatNumberButtonShouldBeDisabledInitially"/>
4540

46-
<!-- Verify that `Validate VAT Number` is available and visible on the current page. -->
47-
<seeElement selector="{{StoreConfigSection.validateVATNumber}}" stepKey="seeVATNumberButton"/>
48-
<waitForPageLoad time="30" stepKey="waitForPageLoad1" />
41+
<!--Open country options section and select an EU Country (`Germany`) -->
42+
<selectOption userInput="{{DE_Address_Berlin_Not_Default_Address.country}}" selector="{{StoreConfigSection.Country}}" stepKey="selectEUStoreCountry"/>
43+
<waitForAjaxLoad stepKey="waitForAjaxToLoadRegionForEuCountry"/>
4944

50-
<!--Fill valid VAT Number for the selected EU Country (Denmark)-->
51-
<fillField selector="{{StoreConfigSection.fillVATNumber}}" userInput="{{DE_Address_Berlin_Not_Default_Address.vatNumber}}" stepKey="fillVATNumberForEU"/>
45+
<!--Fill valid VAT Number for the selected EU Country (Germany)-->
46+
<fillField selector="{{StoreConfigSection.fillVATNumber}}" userInput="{{DE_Address_Berlin_Not_Default_Address.vatNumber}}" stepKey="fillValidVatNumberForEuCountry"/>
5247

53-
<waitForPageLoad time="30" stepKey="waitForPageLoad2" />
54-
<!-- Verify that the page source contains the raw source code `<button class="action-validate-vat">`. -->
55-
<seeInSource html="&#60;button class&#61;&#34;action-validate-vat&#34;" stepKey="seeInSource2"/>
48+
<!-- Verify that the `Validate VAT Number` button should not contain class `disabled` for EU Country-->
49+
<dontSeeElement selector="{{StoreConfigSection.validateVATNumber}}" parameterArray="['class' => 'disabled']" stepKey="validateVatNumberButtonEnabledForEuCountry"/>
5650

5751
<!-- Click the `Validate VAT Number` button. -->
58-
<click selector="{{StoreConfigSection.validateVATNumber}}" stepKey="clickButton"/>
59-
<waitForAjaxLoad stepKey="waitForAjaxLoad2"/>
60-
<waitForElementVisible selector="#validation_result" time="20" stepKey="waitForAssertValidVATNumber"/>
61-
<see selector="#validation_result" userInput="VAT Number is valid." stepKey="validVATNumberResult"/>
62-
<waitForPageLoad time="60" stepKey="wait2" />
52+
<click selector="{{StoreConfigSection.validateVATNumber}}" stepKey="clickValidateVatNumberButton"/>
53+
<waitForAjaxLoad stepKey="waitForAjaxToLoadVatValidationResult"/>
54+
<waitForElementVisible selector="#validation_result" time="20" stepKey="waitForRenderingVatValidationResult"/>
55+
<see selector="#validation_result" userInput="VAT Number is valid." stepKey="seeValidVatNumberResult"/>
6356

64-
<!-- Disable `Validate VAT Number` button for non-EU Country (GB)-->
57+
<!-- Disable `Validate VAT Number` button for non-EU Country (United Kingdom)-->
6558
<selectOption userInput="{{UK_With_State_Default_Billing.country}}" selector="{{StoreConfigSection.Country}}" stepKey="selectNonEUStoreCountry"/>
66-
<waitForAjaxLoad stepKey="waitForAjaxLoad3"/>
59+
<waitForAjaxLoad stepKey="waitForAjaxToLoadRegionForNonEuCountry"/>
6760
<fillField selector="{{StoreConfigSection.fillVATNumber}}" userInput="{{UK_With_State_Default_Billing.vatNumber}}" stepKey="fillVATNumberForNonEU"/>
68-
<waitForPageLoad time="60" stepKey="wait3" />
6961

70-
<!-- Verify that the page source contains the raw source code `<button class="action-validate-vat disabled">`. -->
71-
<seeInSource html="&#60;button class&#61;&#34;action-validate-vat disabled&#34;" stepKey="seeInSource3"/>
62+
<!-- Verify that the `Validate VAT Number` button contains class `disabled` for non-EU Country-->
63+
<seeElement selector="{{StoreConfigSection.validateVATNumber}}" selectorArray="['class' => 'disabled']" stepKey="validateVatNumberButtonDisabledAgain"/>
7264
</test>
7365
</tests>

0 commit comments

Comments
 (0)