Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed getting error in console while selecting all downloadable links #24633 #24634

Merged
merged 1 commit into from
Sep 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
<element name="downloadableLinkByTitle" type="input" selector="//*[@id='downloadable-links-list']/*[contains(.,'{{title}}')]//input" parameterized="true" timeout="30"/>
<element name="downloadableLinkSampleByTitle" type="text" selector="//label[contains(., '{{title}}')]/a[contains(@class, 'sample link')]" parameterized="true"/>
<element name="downloadableSampleLabel" type="text" selector="//a[contains(.,normalize-space('{{title}}'))]" parameterized="true" timeout="30"/>
<element name="downloadableLinkSelectAllCheckbox" type="checkbox" selector="#links_all" />
</section>
</sections>
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
<?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="SelectAllDownloadableLinksDownloadableProductTest">
<annotations>
<features value="Catalog"/>
<stories value="Create Downloadable Product"/>
<title value="Select all downloadable links downloadable product test"/>
<description value="All the downloadable links must be selected or unselected when anyone click on select all or unselect all checkbox respectively."/>
<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: click on select all checkbox -->
<click
selector="{{StorefrontDownloadableProductSection.downloadableLinkSelectAllCheckbox}}"
stepKey="selectAllProductLink"/>

<!-- Step 3: Make sure that all product links are checked -->
<seeCheckboxIsChecked selector="{{StorefrontDownloadableProductSection.downloadableLinkByTitle(downloadableLinkWithMaxDownloads.title)}}" stepKey="seeFirstCheckboxChecked"/>

<seeCheckboxIsChecked selector="{{StorefrontDownloadableProductSection.downloadableLinkByTitle(downloadableLink.title)}}" stepKey="seeSecondCheckboxChecked"/>

<!-- Step 4: click again on select all checkbox -->
<click
selector="{{StorefrontDownloadableProductSection.downloadableLinkSelectAllCheckbox}}"
stepKey="unselectAllProductLink"/>

<!-- Step 5: Make sure that all product links are unchecked -->
<dontSeeCheckboxIsChecked selector="{{StorefrontDownloadableProductSection.downloadableLinkByTitle(downloadableLinkWithMaxDownloads.title)}}" stepKey="seeFirstCheckboxUnChecked"/>

<dontSeeCheckboxIsChecked selector="{{StorefrontDownloadableProductSection.downloadableLinkByTitle(downloadableLink.title)}}" stepKey="seeSecondCheckboxUnChecked"/>

</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ define([
$(element).is('textarea') ||
$('#' + element.id + ' option:selected').length
) {
dataToAdd = $.extend({}, dataToAdd, self._getElementData(element));
if ($(element).data('selector') || $(element).attr('name')) {
dataToAdd = $.extend({}, dataToAdd, self._getElementData(element));
}

return;
}
Expand Down