|
| 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="SelectAllDownloadableLinksDownloadableProductTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Catalog"/> |
| 14 | + <stories value="Create Downloadable Product"/> |
| 15 | + <title value="Select all downloadable links downloadable product test"/> |
| 16 | + <description value="All the downloadable links must be selected or unselected when anyone click on select all or unselect all checkbox respectively."/> |
| 17 | + <severity value="MAJOR"/> |
| 18 | + <group value="Downloadable"/> |
| 19 | + </annotations> |
| 20 | + <before> |
| 21 | + <!-- Create category --> |
| 22 | + <createData entity="SimpleSubCategory" stepKey="createCategory"/> |
| 23 | + |
| 24 | + <!-- Login as admin --> |
| 25 | + <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> |
| 26 | + |
| 27 | + <!-- Create downloadable product --> |
| 28 | + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> |
| 29 | + <waitForPageLoad stepKey="waitForProductGridPageLoad"/> |
| 30 | + <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="createProduct"> |
| 31 | + <argument name="productType" value="downloadable"/> |
| 32 | + </actionGroup> |
| 33 | + |
| 34 | + <!-- Fill downloadable product values --> |
| 35 | + <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillDownloadableProductForm"> |
| 36 | + <argument name="product" value="DownloadableProduct"/> |
| 37 | + </actionGroup> |
| 38 | + |
| 39 | + <!-- Add downloadable product to category --> |
| 40 | + <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" |
| 41 | + parameterArray="[$$createCategory.name$$]" stepKey="fillCategory"/> |
| 42 | + |
| 43 | + <!-- Fill downloadable link information before the creation link --> |
| 44 | + <actionGroup ref="AdminAddDownloadableLinkInformationActionGroup" stepKey="addDownloadableLinkInformation"/> |
| 45 | + |
| 46 | + <!-- Links can be purchased separately --> |
| 47 | + <checkOption selector="{{AdminProductDownloadableSection.isLinksPurchasedSeparately}}" |
| 48 | + stepKey="checkOptionPurchaseSeparately"/> |
| 49 | + |
| 50 | + <!-- Add first downloadable link --> |
| 51 | + <actionGroup ref="addDownloadableProductLinkWithMaxDownloads" stepKey="addFirstDownloadableProductLink"> |
| 52 | + <argument name="link" value="downloadableLinkWithMaxDownloads"/> |
| 53 | + </actionGroup> |
| 54 | + |
| 55 | + <!-- Add second downloadable link --> |
| 56 | + <actionGroup ref="addDownloadableProductLink" stepKey="addSecondDownloadableProductLink"> |
| 57 | + <argument name="link" value="downloadableLink"/> |
| 58 | + </actionGroup> |
| 59 | + |
| 60 | + <!-- Save product --> |
| 61 | + <actionGroup ref="saveProductForm" stepKey="saveProduct"/> |
| 62 | + </before> |
| 63 | + <after> |
| 64 | + <!-- Delete category --> |
| 65 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 66 | + |
| 67 | + <!-- Delete created downloadable product --> |
| 68 | + <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> |
| 69 | + <argument name="product" value="DownloadableProduct"/> |
| 70 | + </actionGroup> |
| 71 | + |
| 72 | + <!-- Log out --> |
| 73 | + <actionGroup ref="logout" stepKey="logout"/> |
| 74 | + </after> |
| 75 | + |
| 76 | + <!-- Step 1: Navigate to store front Product page as guest --> |
| 77 | + <amOnPage url="/{{DownloadableProduct.sku}}.html" |
| 78 | + stepKey="amOnStorefrontProductPage"/> |
| 79 | + |
| 80 | + <!-- Step 2: click on select all checkbox --> |
| 81 | + <click |
| 82 | + selector="{{StorefrontDownloadableProductSection.downloadableLinkSelectAllCheckbox}}" |
| 83 | + stepKey="selectAllProductLink"/> |
| 84 | + |
| 85 | + <!-- Step 3: Make sure that all product links are checked --> |
| 86 | + <seeCheckboxIsChecked selector="{{StorefrontDownloadableProductSection.downloadableLinkByTitle(downloadableLinkWithMaxDownloads.title)}}" stepKey="seeFirstCheckboxChecked"/> |
| 87 | + |
| 88 | + <seeCheckboxIsChecked selector="{{StorefrontDownloadableProductSection.downloadableLinkByTitle(downloadableLink.title)}}" stepKey="seeSecondCheckboxChecked"/> |
| 89 | + |
| 90 | + <!-- Step 4: click again on select all checkbox --> |
| 91 | + <click |
| 92 | + selector="{{StorefrontDownloadableProductSection.downloadableLinkSelectAllCheckbox}}" |
| 93 | + stepKey="unselectAllProductLink"/> |
| 94 | + |
| 95 | + <!-- Step 5: Make sure that all product links are unchecked --> |
| 96 | + <dontSeeCheckboxIsChecked selector="{{StorefrontDownloadableProductSection.downloadableLinkByTitle(downloadableLinkWithMaxDownloads.title)}}" stepKey="seeFirstCheckboxUnChecked"/> |
| 97 | + |
| 98 | + <dontSeeCheckboxIsChecked selector="{{StorefrontDownloadableProductSection.downloadableLinkByTitle(downloadableLink.title)}}" stepKey="seeSecondCheckboxUnChecked"/> |
| 99 | + |
| 100 | + </test> |
| 101 | +</tests> |
0 commit comments