-
Notifications
You must be signed in to change notification settings - Fork 9.3k
/
AdminCreateDownloadableProductWithDefaultSetLinksTest.xml
118 lines (100 loc) · 6.22 KB
/
AdminCreateDownloadableProductWithDefaultSetLinksTest.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="AdminCreateDownloadableProductWithDefaultSetLinksTest">
<annotations>
<features value="Catalog"/>
<stories value="Create Downloadable Product"/>
<title value="Create downloadable product with default set links"/>
<description value="Admin should be able to create downloadable product with default set links"/>
<severity value="CRITICAL"/>
<testCaseId value="MC-14507"/>
<group value="Downloadable"/>
<group value="mtf_migrated"/>
</annotations>
<before>
<magentoCLI stepKey="addDownloadableDomain" command="downloadable:domains:add static.magento.com"/>
<!-- Create category -->
<createData entity="SimpleSubCategory" stepKey="createCategory"/>
<!-- Reindex and clear page cache -->
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
<magentoCLI command="cache:flush" arguments="full_page" stepKey="flushCache"/>
<!-- Login as admin -->
<actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/>
</before>
<after>
<magentoCLI stepKey="removeDownloadableDomain" command="downloadable:domains:remove static.magento.com"/>
<!-- Delete category -->
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
<!-- Delete created downloadable product -->
<actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct">
<argument name="product" value="DownloadableProduct"/>
</actionGroup>
<!-- Log out -->
<actionGroup ref="logout" stepKey="logout"/>
</after>
<!-- Create downloadable product -->
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/>
<waitForPageLoad stepKey="waitForProductGridPageLoad"/>
<actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="createProduct">
<argument name="productType" value="downloadable"/>
</actionGroup>
<!-- Fill downloadable product values -->
<actionGroup ref="fillMainProductFormNoWeight" stepKey="fillDownloadableProductForm">
<argument name="product" value="DownloadableProduct"/>
</actionGroup>
<!-- Add downloadable product to category -->
<searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[$$createCategory.name$$]" stepKey="fillCategory"/>
<!-- Fill downloadable link information before the creation link -->
<actionGroup ref="AdminAddDownloadableLinkInformationActionGroup" stepKey="addDownloadableLinkInformation"/>
<!-- Links can be purchased separately -->
<checkOption selector="{{AdminProductDownloadableSection.isLinksPurchasedSeparately}}" stepKey="checkOptionPurchaseSeparately"/>
<!-- Add first downloadable link -->
<actionGroup ref="addDownloadableProductLinkWithMaxDownloads" stepKey="addFirstDownloadableProductLink">
<argument name="link" value="downloadableLinkWithMaxDownloads"/>
</actionGroup>
<!-- Add second downloadable link -->
<actionGroup ref="addDownloadableProductLink" stepKey="addSecondDownloadableProductLink">
<argument name="link" value="downloadableLink"/>
</actionGroup>
<!-- Save product -->
<actionGroup ref="saveProductForm" stepKey="saveProduct"/>
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
<magentoCLI command="cache:flush" stepKey="flushCache"/>
<!-- Find downloadable product in grid -->
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/>
<waitForPageLoad stepKey="waitForAdminProductPageLoad"/>
<actionGroup ref="filterProductGridBySku" stepKey="findCreatedConfigurableProduct">
<argument name="product" value="DownloadableProduct"/>
</actionGroup>
<click selector="{{AdminProductGridSection.firstRow}}" stepKey="clickOnProduct"/>
<waitForPageLoad stepKey="waitForProductPageLoad"/>
<!-- Assert downloadable links in product form -->
<scrollTo selector="{{AdminProductDownloadableSection.sectionLinkGrid}}" stepKey="scrollToLinks"/>
<seeElement selector="{{AdminProductDownloadableSection.addLinkTitleInput('0')}}" stepKey="seeFirstLinkTitle"/>
<seeElement selector="{{AdminProductDownloadableSection.addLinkTitleInput('1')}}" stepKey="seeSecondLinkTitle"/>
<!-- Go to storefront category page -->
<amOnPage url="$$createCategory.name$$.html" stepKey="amOnCategoryPage"/>
<waitForPageLoad stepKey="waitForCategoryPageLoad"/>
<!-- Assert product in storefront category page -->
<actionGroup ref="StorefrontCheckProductPriceInCategoryActionGroup" stepKey="StorefrontCheckCategorySimpleProduct">
<argument name="product" value="DownloadableProduct"/>
</actionGroup>
<!-- Assert product in storefront product page -->
<actionGroup ref="AssertProductNameAndSkuInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage">
<argument name="product" value="DownloadableProduct"/>
</actionGroup>
<!-- See product links in storefront product page -->
<scrollTo selector="{{StorefrontDownloadableProductSection.downloadableLinkBlock}}" stepKey="scrollToLinksInStorefront"/>
<seeElement stepKey="seeFirstDownloadableLink" selector="{{StorefrontDownloadableProductSection.downloadableLinkLabel(downloadableLinkWithMaxDownloads.title)}}"/>
<seeElement stepKey="seeSecondDownloadableLink" selector="{{StorefrontDownloadableProductSection.downloadableLinkLabel(downloadableLink.title)}}"/>
<!-- Assert product in stock -->
<see selector="{{StorefrontProductInfoMainSection.productStockStatus}}" userInput="In Stock" stepKey="seeProductStatusInStoreFront"/>
</test>
</tests>