|
| 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="StorefrontSpecialPriceForDifferentTimezonesForWebsitesTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Catalog"/> |
| 14 | + <title value="Check that special price displayed when 'default config' scope timezone does not match 'website' scope timezone"/> |
| 15 | + <description value="Check that special price displayed when 'default config' scope timezone does not match 'website' scope timezone"/> |
| 16 | + <severity value="MAJOR"/> |
| 17 | + <testCaseId value="MAGETWO-97508"/> |
| 18 | + <useCaseId value="MAGETWO-96847"/> |
| 19 | + <group value="Catalog"/> |
| 20 | + </annotations> |
| 21 | + <before> |
| 22 | + <actionGroup ref="LoginAsAdmin" stepKey="login"/> |
| 23 | + |
| 24 | + <!--Create product--> |
| 25 | + <createData entity="SimpleProduct2" stepKey="createProduct"/> |
| 26 | + |
| 27 | + <!--Create customer--> |
| 28 | + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> |
| 29 | + </before> |
| 30 | + <after> |
| 31 | + <!--Delete create data--> |
| 32 | + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> |
| 33 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 34 | + |
| 35 | + <actionGroup ref="logout" stepKey="logout"/> |
| 36 | + </after> |
| 37 | + |
| 38 | + <!--Set timezone for default config--> |
| 39 | + <amOnPage url="{{GeneralConfigurationPage.url}}" stepKey="goToGeneralConfig"/> |
| 40 | + <waitForPageLoad stepKey="waitForConfigPage"/> |
| 41 | + <conditionalClick selector="{{LocaleOptionsSection.sectionHeader}}" dependentSelector="{{LocaleOptionsSection.timezone}}" visible="false" stepKey="openLocaleSection"/> |
| 42 | + <grabValueFrom selector="{{LocaleOptionsSection.timezone}}" stepKey="originalTimezone"/> |
| 43 | + <selectOption selector="{{LocaleOptionsSection.timezone}}" userInput="Central European Standard Time (Europe/Paris)" stepKey="setTimezone"/> |
| 44 | + <click selector="{{AdminMainActionsSection.save}}" stepKey="saveConfig"/> |
| 45 | + |
| 46 | + <!--Set timezone for Main Website--> |
| 47 | + <amOnPage url="{{GeneralConfigurationPage.url}}" stepKey="goToGeneralConfig1"/> |
| 48 | + <waitForPageLoad stepKey="waitForConfigPage1"/> |
| 49 | + <actionGroup ref="AdminSwitchWebsiteActionGroup" stepKey="AdminSwitchStoreViewActionGroup"> |
| 50 | + <argument name="website" value="_defaultWebsite"/> |
| 51 | + </actionGroup> |
| 52 | + <conditionalClick selector="{{LocaleOptionsSection.sectionHeader}}" dependentSelector="{{LocaleOptionsSection.timezone}}" visible="false" stepKey="openLocaleSection1"/> |
| 53 | + <uncheckOption selector="{{LocaleOptionsSection.useDefault}}" stepKey="uncheckUseDefault"/> |
| 54 | + <grabValueFrom selector="{{LocaleOptionsSection.timezone}}" stepKey="originalTimezone1"/> |
| 55 | + <selectOption selector="{{LocaleOptionsSection.timezone}}" userInput="Greenwich Mean Time (Africa/Abidjan)" stepKey="setTimezone1"/> |
| 56 | + <click selector="{{AdminMainActionsSection.save}}" stepKey="saveConfig1"/> |
| 57 | + |
| 58 | + <!--Set special price to created product--> |
| 59 | + <amOnPage url="{{AdminProductEditPage.url($$createProduct.id$$)}}" stepKey="openAdminEditPage"/> |
| 60 | + <actionGroup ref="AddSpecialPriceToProductActionGroup" stepKey="setSpecialPriceToCreatedProduct"> |
| 61 | + <argument name="price" value="15"/> |
| 62 | + </actionGroup> |
| 63 | + <actionGroup ref="saveProductForm" stepKey="saveProductForm"/> |
| 64 | + |
| 65 | + <!--Login to storefront from customer and check price--> |
| 66 | + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="logInFromCustomer"> |
| 67 | + <argument name="Customer" value="$$createCustomer$$"/> |
| 68 | + </actionGroup> |
| 69 | + |
| 70 | + <!--Go to the product page and check special price--> |
| 71 | + <amOnPage url="{{StorefrontProductPage.url($$createProduct.name$$)}}" stepKey="amOnSimpleProductPage"/> |
| 72 | + <waitForPageLoad stepKey="waitForPageLoad"/> |
| 73 | + <grabTextFrom selector="{{StorefrontProductInfoMainSection.specialPriceValue}}" stepKey="grabSpecialPrice"/> |
| 74 | + <assertEquals expected='$15.00' expectedType="string" actual="$grabSpecialPrice" stepKey="assertSpecialPrice"/> |
| 75 | + |
| 76 | + <!--Reset timezone--> |
| 77 | + <amOnPage url="{{GeneralConfigurationPage.url}}" stepKey="goToGeneralConfigReset"/> |
| 78 | + <waitForPageLoad stepKey="waitForConfigPageReset"/> |
| 79 | + <conditionalClick selector="{{LocaleOptionsSection.sectionHeader}}" dependentSelector="{{LocaleOptionsSection.timezone}}" visible="false" stepKey="openLocaleSectionReset"/> |
| 80 | + <selectOption selector="{{LocaleOptionsSection.timezone}}" userInput="$originalTimezone" stepKey="resetTimezone"/> |
| 81 | + <click selector="{{AdminMainActionsSection.save}}" stepKey="saveConfigReset"/> |
| 82 | + |
| 83 | + <!--Reset timezone--> |
| 84 | + <amOnPage url="{{GeneralConfigurationPage.url}}" stepKey="goToGeneralConfigReset1"/> |
| 85 | + <waitForPageLoad stepKey="waitForConfigPageReset1"/> |
| 86 | + <actionGroup ref="AdminSwitchWebsiteActionGroup" stepKey="AdminSwitchStoreViewActionGroup1"> |
| 87 | + <argument name="website" value="_defaultWebsite"/> |
| 88 | + </actionGroup> |
| 89 | + <conditionalClick selector="{{LocaleOptionsSection.sectionHeader}}" dependentSelector="{{LocaleOptionsSection.timezone}}" visible="false" stepKey="openLocaleSectionReset1"/> |
| 90 | + <uncheckOption selector="{{LocaleOptionsSection.useDefault}}" stepKey="uncheckUseDefault1"/> |
| 91 | + <selectOption selector="{{LocaleOptionsSection.timezone}}" userInput="$originalTimezone" stepKey="resetTimezone1"/> |
| 92 | + <click selector="{{AdminMainActionsSection.save}}" stepKey="saveConfigReset1"/> |
| 93 | + </test> |
| 94 | +</tests> |
0 commit comments