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 =" ../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd" >
11+ <test name =" AdminMultipleWebsitesUseDefaultValuesTest" >
12+ <annotations >
13+ <title value =" Use Default Value checkboxes should be checked for new website scope" />
14+ <description value =" Use Default Value checkboxes for product attribute should be checked for new website scope" />
15+ <severity value =" MAJOR" />
16+ <testCaseId value =" MAGETWO-92454" />
17+ <group value =" Catalog" />
18+ </annotations >
19+ <after >
20+ <actionGroup ref =" AdminDeleteWebsiteActionGroup" stepKey =" deleteSecondWebsite" >
21+ <argument name =" websiteName" value =" Second Website" />
22+ </actionGroup >
23+ <amOnPage url =" admin/admin/auth/logout/" stepKey =" amOnLogoutPage" />
24+ </after >
25+ <actionGroup ref =" LoginActionGroup" stepKey =" loginAsAdmin" />
26+ <actionGroup ref =" AdminCreateWebsiteActionGroup" stepKey =" createAdditionalWebsite" >
27+ <argument name =" newWebsiteName" value =" Second Website" />
28+ <argument name =" websiteCode" value =" second_website" />
29+ </actionGroup >
30+ <actionGroup ref =" AdminCreateNewStoreGroupActionGroup" stepKey =" createNewStore" >
31+ <argument name =" website" value =" Second Website" />
32+ <argument name =" storeGroupName" value =" Second Store" />
33+ <argument name =" storeGroupCode" value =" second_store" />
34+ </actionGroup >
35+
36+ <!-- Create Store view -->
37+ <amOnPage url =" {{AdminSystemStorePage.url}}" stepKey =" amOnAdminSystemStorePage" />
38+ <click selector =" {{AdminStoresMainActionsSection.createStoreViewButton}}" stepKey =" createStoreViewButton" />
39+ <waitForPageLoad stepKey =" waitForProductPageLoad" />
40+ <selectOption userInput =" Second Store" selector =" {{AdminNewStoreSection.storeGrpDropdown}}" stepKey =" selectStoreGroup" />
41+ <fillField userInput =" Second Store View" selector =" {{AdminNewStoreSection.storeNameTextField}}" stepKey =" fillStoreViewName" />
42+ <fillField userInput =" second_store_view" selector =" {{AdminNewStoreSection.storeCodeTextField}}" stepKey =" fillStoreViewCode" />
43+ <selectOption selector =" {{AdminNewStoreSection.statusDropdown}}" userInput =" 1" stepKey =" enableStoreViewStatus" />
44+ <click selector =" {{AdminStoresMainActionsSection.saveButton}}" stepKey =" clickStoreViewSaveButton" />
45+ <waitForElementVisible selector =" {{AdminNewStoreSection.acceptNewStoreViewCreation}}" stepKey =" waitForAcceptNewStoreViewCreationModal" />
46+ <conditionalClick selector =" {{AdminNewStoreSection.acceptNewStoreViewCreation}}" dependentSelector =" {{AdminNewStoreSection.acceptNewStoreViewCreation}}" visible =" true" stepKey =" AcceptNewStoreViewCreation" />
47+ <waitForElementVisible selector =" {{AdminStoresGridSection.storeFilterTextField}}" stepKey =" waitForPageReload" />
48+ <see userInput =" You saved the store view." stepKey =" seeSaveMessage" />
49+
50+ <!-- Create a Simple Product -->
51+ <amOnPage url =" {{AdminProductIndexPage.url}}" stepKey =" navigateToCatalogProductGrid" />
52+ <click selector =" {{AdminProductGridActionSection.addProductToggle}}" stepKey =" clickAddProductDropdown" />
53+ <click selector =" {{AdminProductGridActionSection.addSimpleProduct}}" stepKey =" clickAddSimpleProduct" />
54+ <fillField userInput =" {{_defaultProduct.name}}" selector =" {{AdminProductFormSection.productName}}" stepKey =" fillProductName" />
55+ <fillField userInput =" {{_defaultProduct.sku}}" selector =" {{AdminProductFormSection.productSku}}" stepKey =" fillProductSKU" />
56+ <fillField userInput =" {{_defaultProduct.price}}" selector =" {{AdminProductFormSection.productPrice}}" stepKey =" fillProductPrice" />
57+ <fillField userInput =" {{_defaultProduct.quantity}}" selector =" {{AdminProductFormSection.productQuantity}}" stepKey =" fillProductQuantity" />
58+
59+ <!-- Add product to second website and save the product -->
60+ <click selector =" {{ProductInWebsitesSection.sectionHeader}}" stepKey =" openProductInWebsites" />
61+ <click selector =" {{ProductInWebsitesSection.website('Second Website')}}" stepKey =" selectSecondWebsite" />
62+ <click selector =" {{AdminProductFormActionSection.saveButton}}" stepKey =" clickSave" />
63+ <waitForLoadingMaskToDisappear stepKey =" waitForProductPageSave" />
64+ <seeElement selector =" {{AdminProductMessagesSection.successMessage}}" stepKey =" seeSaveProductMessage" />
65+
66+ <!-- switch to the second store view -->
67+ <click selector =" {{AdminProductFormActionSection.changeStoreButton}}" stepKey =" clickStoreviewSwitcher" />
68+ <click selector =" {{AdminProductFormActionSection.selectStoreView('Second Store View')}}" stepKey =" chooseStoreView" />
69+ <click selector =" {{AdminConfirmationModalSection.ok}}" stepKey =" acceptStoreSwitchingMessage" />
70+ <!-- <waitForPageLoad stepKey="waitForStoreViewSwitched"/>-->
71+ <waitForPageLoad time =" 30" stepKey =" waitForPageLoad9" />
72+ <see userInput =" Second Store View" selector =" {{AdminMainActionsSection.storeSwitcher}}" stepKey =" seeNewStoreViewName" />
73+
74+ <!-- Check if Use Default Value checkboxes are checked -->
75+ <seeCheckboxIsChecked selector =" {{AdminProductFormSection.productStatusUseDefault}}" stepKey =" seeProductStatusCheckboxChecked" />
76+ <seeCheckboxIsChecked selector =" {{AdminProductFormSection.productNameUseDefault}}" stepKey =" seeProductNameCheckboxChecked" />
77+ <seeCheckboxIsChecked selector =" {{AdminProductFormSection.productTaxClassUseDefault}}" stepKey =" seeTaxClassCheckboxChecked" />
78+ <seeCheckboxIsChecked selector =" {{AdminProductFormSection.visibilityUseDefault}}" stepKey =" seeVisibilityCheckboxChecked" />
79+ </test >
80+ </tests >
0 commit comments