|
15 | 15 | <description value="Sorting products by websites in Admin"/>
|
16 | 16 | </annotations>
|
17 | 17 | <before>
|
| 18 | + <createData entity="_defaultCategory" stepKey="createCategory"/> |
| 19 | + <createData entity="_defaultProduct" stepKey="productAssignedToCustomWebsite"> |
| 20 | + <requiredEntity createDataKey="createCategory"/> |
| 21 | + </createData> |
| 22 | + <createData entity="SimpleProduct" stepKey="productAssignedToMainWebsite"> |
| 23 | + <requiredEntity createDataKey="createCategory"/> |
| 24 | + </createData> |
| 25 | + |
18 | 26 | <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
|
19 | 27 | <!--Create new website -->
|
20 | 28 | <actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="createAdditionalWebsite">
|
21 | 29 | <argument name="newWebsiteName" value="{{customWebsite.name}}"/>
|
22 | 30 | <argument name="websiteCode" value="{{customWebsite.code}}"/>
|
23 | 31 | </actionGroup>
|
| 32 | + <actionGroup ref="EnableWebUrlOptions" stepKey="addStoreCodeToUrls"/> |
| 33 | + <magentoCLI command="cache:flush" stepKey="flushCacheAfterEnableWebUrlOptions"/> |
24 | 34 | </before>
|
25 | 35 | <after>
|
| 36 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 37 | + <deleteData createDataKey="productAssignedToCustomWebsite" stepKey="deleteProductAssignedToCustomWebsite"/> |
| 38 | + <deleteData createDataKey="productAssignedToMainWebsite" stepKey="deleteProductAssignedToMainWebsite"/> |
26 | 39 | <actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteTestWebsite">
|
27 | 40 | <argument name="websiteName" value="{{customWebsite.name}}"/>
|
28 | 41 | </actionGroup>
|
| 42 | + <actionGroup ref="ResetWebUrlOptions" stepKey="resetUrlOption"/> |
| 43 | + <magentoCLI command="indexer:reindex" stepKey="reindex"/> |
| 44 | + <magentoCLI command="cache:flush" stepKey="flushCache"/> |
29 | 45 | <actionGroup ref="logout" stepKey="logout"/>
|
30 | 46 | </after>
|
31 | 47 |
|
32 |
| - <actionGroup ref="EnableWebUrlOptions" stepKey="addStoreCodeToUrls"/> |
33 |
| - <!--Create a Simple Product --> |
| 48 | + <!--Assign Custom Website to Simple Product --> |
34 | 49 | <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToCatalogProductGrid"/>
|
35 | 50 | <waitForPageLoad stepKey="waitForCatalogProductGrid"/>
|
36 |
| - <click selector="{{AdminProductGridActionSection.addProductToggle}}" stepKey="clickAddProductDropdown"/> |
37 |
| - <click selector="{{AdminProductGridActionSection.addSimpleProduct}}" stepKey="clickAddSimpleProduct"/> |
38 |
| - <fillField userInput="{{_defaultProduct.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="fillName"/> |
39 |
| - <fillField userInput="{{_defaultProduct.sku}}" selector="{{AdminProductFormSection.productSku}}" stepKey="fillSKU"/> |
40 |
| - <fillField userInput="{{_defaultProduct.price}}" selector="{{AdminProductFormSection.productPrice}}" stepKey="fillPrice"/> |
41 |
| - <fillField userInput="{{_defaultProduct.quantity}}" selector="{{AdminProductFormSection.productQuantity}}" stepKey="fillQuantity"/> |
42 | 51 |
|
43 |
| - <!--Save the product --> |
44 |
| - <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveButton"/> |
45 |
| - <waitForLoadingMaskToDisappear stepKey="waitProductPageSave"/> |
46 |
| - <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeProductSavedMessage"/> |
| 52 | + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> |
| 53 | + <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="assignCustomWebsiteToProduct"> |
| 54 | + <argument name="product" value="$$productAssignedToCustomWebsite$$"/> |
| 55 | + </actionGroup> |
| 56 | + <scrollTo selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="scrollToWebsites"/> |
| 57 | + <conditionalClick selector="{{ProductInWebsitesSection.sectionHeader}}" dependentSelector="{{AdminProductContentSection.sectionHeaderShow}}" visible="false" stepKey="expandSection"/> |
| 58 | + <waitForPageLoad stepKey="waitForPageOpened"/> |
| 59 | + <uncheckOption selector="{{ProductInWebsitesSection.website(_defaultWebsite.name)}}" stepKey="deselectMainWebsite"/> |
| 60 | + <checkOption selector="{{ProductInWebsitesSection.website(customWebsite.name)}}" stepKey="selectWebsite"/> |
47 | 61 |
|
48 |
| - <!-- Add this product to second website --> |
49 |
| - <click selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="openProductInWebsitesSection1"/> |
50 |
| - <click selector="{{ProductInWebsitesSection.website('{{customWebsite.name}}')}}" stepKey="selectSecondWebsite"/> |
51 | 62 | <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSave"/>
|
52 |
| - <waitForLoadingMaskToDisappear stepKey="waitForProductPagetoSaveAgain"/> |
| 63 | + <waitForLoadingMaskToDisappear stepKey="waitForProductPageToSaveAgain"/> |
53 | 64 | <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSaveProductMessageAgain"/>
|
54 | 65 |
|
55 |
| - <!--Create a Simple Product 2 --> |
56 |
| - <amOnPage url="{{ProductCatalogPage.url}}" stepKey="openProductCatalogPage"/> |
57 |
| - <waitForPageLoad stepKey="waitForProductCatalogPage"/> |
58 |
| - <click selector="{{AdminProductGridActionSection.addProductToggle}}" stepKey="clickAddProductToggle"/> |
59 |
| - <waitForPageLoad stepKey="waitForProductToggleToSelectSimpleProduct"/> |
60 |
| - <click selector="{{AdminProductGridActionSection.addSimpleProduct}}" stepKey="clickSimpleProductFromDropDownList"/> |
61 |
| - |
62 |
| - <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{nameAndAttributeSkuMaskSimpleProduct.name}}" stepKey="fillSimpleProductName"/> |
63 |
| - <fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{nameAndAttributeSkuMaskSimpleProduct.price}}" stepKey="fillSimpleProductPrice"/> |
64 |
| - <fillField selector="{{AdminProductFormSection.productWeight}}" userInput="{{nameAndAttributeSkuMaskSimpleProduct.weight}}" stepKey="fillSimpleProductWeight"/> |
65 |
| - <fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{nameAndAttributeSkuMaskSimpleProduct.quantity}}" stepKey="fillSimpleProductQuantity"/> |
66 |
| - <click selector="{{AdminProductFormSection.save}}" stepKey="clickSaveButton2"/> |
67 |
| - <waitForPageLoad stepKey="waitForSimpleProductToSave"/> |
68 |
| - <!-- Verify customer see success message --> |
69 |
| - <see selector="{{AdminProductFormSection.successMessage}}" userInput="You saved the product." stepKey="seeAssertSimpleProductSaveSuccessMessage"/> |
70 |
| - |
71 |
| - <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToCatalogProductGrid2"/> |
72 |
| - <waitForPageLoad stepKey="waitForCatalogProductGrid2"/> |
| 66 | + <!--Navigate To Product Grid To Check Website Sorting--> |
| 67 | + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToCatalogProductGridToSortByWebsite"/> |
| 68 | + <waitForPageLoad stepKey="waitForCatalogProductGridLoaded"/> |
73 | 69 |
|
74 | 70 | <!--Sorting works (By Websites) ASC-->
|
75 |
| - <actionGroup ref="resetProductGridToDefaultView" stepKey="setProductGridToDefaultSortingWebsites"/> |
76 | 71 | <click selector="{{AdminProductGridSection.columnHeader('Websites')}}" stepKey="clickWebsitesHeaderToSortAsc"/>
|
77 | 72 | <see selector="{{AdminProductGridSection.productGridContentsOnRow('1')}}" userInput="Main Website" stepKey="checkIfProduct1WebsitesAsc"/>
|
78 |
| - <see selector="{{AdminProductGridSection.productGridContentsOnRow('2')}}" userInput="{{customWebsite.name}}" stepKey="checkIfProduct2WebsitesAsc"/> |
79 | 73 |
|
80 | 74 | <!--Sorting works (By Websites) DESC-->
|
81 | 75 | <click selector="{{AdminProductGridSection.columnHeader('Websites')}}" stepKey="clickWebsitesHeaderToSortDesc"/>
|
82 | 76 | <see selector="{{AdminProductGridSection.productGridContentsOnRow('1')}}" userInput="{{customWebsite.name}}" stepKey="checkIfProduct1WebsitesDesc"/>
|
83 |
| - <see selector="{{AdminProductGridSection.productGridContentsOnRow('2')}}" userInput="Main Website" stepKey="checkIfProduct2WebsitesDesc"/> |
84 | 77 | </test>
|
85 | 78 | </tests>
|
0 commit comments