Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue#24785: Added JS method to handle input checks with MFTF
- Loading branch information
Showing
3 changed files
with
148 additions
and
0 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
122 changes: 122 additions & 0 deletions
122
...o/Downloadable/Test/Mftf/Test/ManualSelectAllDownloadableLinksDownloadableProductTest.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,122 @@ | ||
<?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="ManualSelectAllDownloadableLinksDownloadableProductTest"> | ||
<annotations> | ||
<features value="Catalog"/> | ||
<stories value="Create Downloadable Product"/> | ||
<title value="Manual select all downloadable links downloadable product test"/> | ||
<description value="Manually selecting all downloadable links must change 'Select/Unselect all' button label to 'Unselect all', and 'Select all' otherwise"/> | ||
<severity value="MAJOR"/> | ||
<group value="Downloadable"/> | ||
</annotations> | ||
<before> | ||
<!-- Create category --> | ||
<createData entity="SimpleSubCategory" stepKey="createCategory"/> | ||
|
||
<!-- Login as admin --> | ||
<actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> | ||
|
||
<!-- 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"/> | ||
</before> | ||
<after> | ||
<!-- 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> | ||
|
||
<!-- Step 1: Navigate to store front Product page as guest --> | ||
<amOnPage url="/{{DownloadableProduct.sku}}.html" | ||
stepKey="amOnStorefrontProductPage"/> | ||
|
||
<!-- Step 2: Check first downloadable link checkbox --> | ||
<click | ||
selector="{{StorefrontDownloadableProductSection.downloadableLinkByTitle(downloadableLinkWithMaxDownloads.title)}}" | ||
stepKey="selectFirstCheckbox"/> | ||
|
||
<!-- Step 3: Check second downloadable link checkbox --> | ||
<click | ||
selector="{{StorefrontDownloadableProductSection.downloadableLinkByTitle(downloadableLink.title)}}" | ||
stepKey="selectSecondCheckbox"/> | ||
|
||
<!-- Step 4: Grab "Select/Unselect All" button label text --> | ||
<grabTextFrom | ||
selector="{{StorefrontDownloadableProductSection.downloadableLinkSelectAllLabel}}" | ||
stepKey="grabUnselectAllButtonText"/> | ||
|
||
<!-- Step 5: Assert that 'Select/Unselect all' button text is 'Unselect all' after manually checking all checkboxes --> | ||
<assertEquals | ||
message="Assert that 'Select/Unselect all' button text is 'Unselect all' after manually checking all checkboxes" | ||
stepKey="assertButtonTextOne"> | ||
<expectedResult type="string">Unselect all</expectedResult> | ||
<actualResult type="string">{$grabUnselectAllButtonText}</actualResult> | ||
</assertEquals> | ||
|
||
<!-- Step 6: Uncheck second downloadable link checkbox --> | ||
<click | ||
selector="{{StorefrontDownloadableProductSection.downloadableLinkByTitle(downloadableLink.title)}}" | ||
stepKey="unselectSecondCheckbox"/> | ||
|
||
<!-- Step 7: Grab "Select/Unselect All" button label text --> | ||
<grabTextFrom | ||
selector="{{StorefrontDownloadableProductSection.downloadableLinkSelectAllLabel}}" | ||
stepKey="grabSelectAllButtonText"/> | ||
|
||
<!-- Step 8: Assert that 'Select/Unselect all' button text is 'Select all' after manually unchecking one checkbox --> | ||
<assertEquals | ||
message="Assert that 'Select/Unselect all' button text is 'Select all' after manually unchecking one checkbox" | ||
stepKey="assertButtonTextTwo"> | ||
<expectedResult type="string">Select all</expectedResult> | ||
<actualResult type="string">{$grabSelectAllButtonText}</actualResult> | ||
</assertEquals> | ||
|
||
</test> | ||
</tests> |
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