-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix samples accessible when product is out of stock
- Loading branch information
1 parent
def5104
commit f9d4e0a
Showing
3 changed files
with
165 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 78 additions & 0 deletions
78
...wnloadable/Test/Mftf/Test/VerifyOutOfStockDownloadableProductSamplesAreAccessibleTest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
<?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="VerifyOutOfStockDownloadableProductSamplesAreAccessibleTest"> | ||
<annotations> | ||
<features value="Downloadable"/> | ||
<stories value="Downloadable product"/> | ||
<title value="Samples of Downloadable Products are accessible, if product is out of stock"/> | ||
<description value="Samples of Downloadable Products are accessible, if product is out of stock"/> | ||
<severity value="MAJOR"/> | ||
<group value="downloadable"/> | ||
<group value="catalog"/> | ||
</annotations> | ||
<before> | ||
<!-- Enable show out of stock product --> | ||
<magentoCLI stepKey="enableShowOutOfStockProduct" command="config:set cataloginventory/options/show_out_of_stock 1"/> | ||
|
||
<!-- Add downloadable domains --> | ||
<magentoCLI stepKey="addDownloadableDomain" command="downloadable:domains:add example.com static.magento.com"/> | ||
|
||
<!-- Create category --> | ||
<createData entity="_defaultCategory" stepKey="createCategory"/> | ||
|
||
<!-- Create downloadable product --> | ||
<createData entity="DownloadableProductWithoutLinksOutOfStock" stepKey="createProduct"> | ||
<requiredEntity createDataKey="createCategory"/> | ||
</createData> | ||
|
||
<!-- Add downloadable link --> | ||
<createData entity="downloadableLink1" stepKey="addDownloadableLink"> | ||
<requiredEntity createDataKey="createProduct"/> | ||
</createData> | ||
|
||
<!-- Add downloadable sample --> | ||
<createData entity="DownloadableSample" stepKey="addDownloadableSample"> | ||
<requiredEntity createDataKey="createProduct"/> | ||
</createData> | ||
</before> | ||
<after> | ||
<!-- Disable show out of stock product --> | ||
<magentoCLI stepKey="enableShowOutOfStockProduct" command="config:set cataloginventory/options/show_out_of_stock 0"/> | ||
|
||
<!-- Remove downloadable domains --> | ||
<magentoCLI stepKey="removeDownloadableDomain" command="downloadable:domains:remove example.com static.magento.com"/> | ||
|
||
<!-- Delete product --> | ||
<deleteData createDataKey="createProduct" stepKey="deleteDownloadableProduct"/> | ||
|
||
<!-- Delete category --> | ||
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/> | ||
|
||
<!-- Admin logout --> | ||
<actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> | ||
</after> | ||
|
||
<!-- Open Downloadable product from precondition on Storefront --> | ||
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openStorefrontProductPage"> | ||
<argument name="productUrl" value="$createProduct.custom_attributes[url_key]$"/> | ||
</actionGroup> | ||
|
||
<!-- Sample url is accessible --> | ||
<actionGroup ref="AssertStorefrontSeeElementActionGroup" stepKey="seeDownloadableSample"> | ||
<argument name="selector" value="{{StorefrontDownloadableProductSection.downloadableSampleLabel(DownloadableSample.title)}}"/> | ||
</actionGroup> | ||
<click selector="{{StorefrontDownloadableProductSection.downloadableSampleLabel(DownloadableSample.title)}}" stepKey="clickDownloadableSample"/> | ||
<switchToNextTab stepKey="switchToSampleTab"/> | ||
<wait time="2" stepKey="waitToMakeSureThereWillBeNoRedirectToHomePage"/> | ||
<seeInCurrentUrl url="downloadable/download/sample/sample_id/" stepKey="amOnSampleDownloadPage"/> | ||
<closeTab stepKey="closeSampleTab"/> | ||
</test> | ||
</tests> |