-
Notifications
You must be signed in to change notification settings - Fork 9.4k
fix Can't remove samples link product downloadable #31895
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
base: 2.4-develop
Are you sure you want to change the base?
Changes from 9 commits
5115368
eb9bcc1
9e0e86e
d13aa48
3817a8a
8f7773c
8372d21
7651b1a
ffb9295
1abd820
2ea8e8c
ba36d39
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> | ||
<actionGroup name="RemoveSampleActionGroup"> | ||
<annotations> | ||
<description>Delete Downloadable Product Sample by row id.</description> | ||
</annotations> | ||
<arguments> | ||
<argument name="index" type="string" defaultValue="0"/> | ||
</arguments> | ||
|
||
<waitForElementVisible selector="{{AdminProductDownloadableSection.addSampleRemoveRowButton(index)}}" stepKey="waitForSample"/> | ||
<click selector="{{AdminProductDownloadableSection.addSampleRemoveRowButton(index)}}" stepKey="deleteSample"/> | ||
</actionGroup> | ||
</actionGroups> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> | ||
<actionGroup name="VerifySampleAbsentActionGroup"> | ||
<annotations> | ||
<description>Verify Samples are absent on Downloadable Product page.</description> | ||
</annotations> | ||
<arguments> | ||
<argument name="index" type="string" defaultValue="0"/> | ||
</arguments> | ||
|
||
<dontSeeElement selector="{{AdminProductDownloadableSection.addSampleTitleInput(index)}}" stepKey="verifySamplesAbsent"/> | ||
</actionGroup> | ||
</actionGroups> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> | ||
<actionGroup name="VerifySamplePresentActionGroup"> | ||
<annotations> | ||
<description>Verify Sample is present on Downloadable Product page.</description> | ||
</annotations> | ||
<arguments> | ||
<argument name="index" type="string" defaultValue="0"/> | ||
</arguments> | ||
|
||
<seeElement selector="{{AdminProductDownloadableSection.addSampleTitleInput(index)}}" stepKey="verifySampleVisible"/> | ||
</actionGroup> | ||
</actionGroups> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
<?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="AdminDeleteDownloadableProductSampleTest"> | ||
<annotations> | ||
<features value="Catalog"/> | ||
<stories value="Delete Downloadable Product"/> | ||
<title value="Delete Downloadable Product Samples"/> | ||
<description value="Admin should be able to delete downloadable product samples"/> | ||
<severity value="MAJOR"/> | ||
<group value="Downloadable"/> | ||
</annotations> | ||
<before> | ||
<magentoCLI command="downloadable:domains:add static.magento.com" stepKey="addDownloadableDomain"/> | ||
<createData entity="SimpleSubCategory" stepKey="createCategory"/> | ||
<actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> | ||
</before> | ||
<after> | ||
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/> | ||
<actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> | ||
<argument name="product" value="DownloadableProduct"/> | ||
</actionGroup> | ||
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> | ||
<magentoCLI command="downloadable:domains:remove static.magento.com" stepKey="removeDownloadableDomain"/> | ||
</after> | ||
|
||
<!-- Create downloadable product --> | ||
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="amOnProductGridPage"/> | ||
<actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="createProduct"> | ||
<argument name="productType" value="downloadable"/> | ||
</actionGroup> | ||
|
||
<!-- Fill downloadable product values --> | ||
gabrieldagama marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillDownloadableProductForm"> | ||
<argument name="product" value="DownloadableProduct"/> | ||
</actionGroup> | ||
|
||
<!-- Add downloadable product to category --> | ||
gabrieldagama marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" | ||
parameterArray="[$$createCategory.name$$]" stepKey="fillCategory"/> | ||
|
||
<!-- Fill downloadable link information before the creation link --> | ||
gabrieldagama marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<actionGroup ref="AdminAddDownloadableLinkInformationActionGroup" stepKey="addDownloadableLinkInformation"/> | ||
|
||
<!-- Links can be purchased separately --> | ||
gabrieldagama marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<checkOption selector="{{AdminProductDownloadableSection.isLinksPurchasedSeparately}}" | ||
stepKey="checkOptionPurchaseSeparately"/> | ||
|
||
<!-- Add downloadable link --> | ||
gabrieldagama marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<actionGroup ref="AddDownloadableProductLinkWithMaxDownloadsActionGroup" stepKey="addDownloadableProductLink"> | ||
<argument name="link" value="downloadableLinkWithMaxDownloads"/> | ||
</actionGroup> | ||
|
||
<!-- Add Sample File --> | ||
gabrieldagama marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<actionGroup ref="AddDownloadableSampleFileActionGroup" stepKey="addDownloadSampleFile"> | ||
<argument name="sample" value="downloadableSampleFile"/> | ||
</actionGroup> | ||
|
||
<!-- Add Sample Url --> | ||
gabrieldagama marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<actionGroup ref="AddDownloadableSampleUrlActionGroup" stepKey="addDownloadableSampleUrl"> | ||
<argument name="sample" value="downloadableSampleUrl"/> | ||
</actionGroup> | ||
|
||
<!-- Save product --> | ||
gabrieldagama marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> | ||
|
||
<!-- Check if Samples are present --> | ||
gabrieldagama marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<actionGroup ref="VerifySamplePresentActionGroup" stepKey="verifySampleFilePresent"> | ||
<argument name="index" value="0"/> | ||
</actionGroup> | ||
<actionGroup ref="VerifySamplePresentActionGroup" stepKey="verifySampleUrlPresent"> | ||
<argument name="index" value="1"/> | ||
</actionGroup> | ||
|
||
<!-- Remove Samples --> | ||
gabrieldagama marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<actionGroup ref="RemoveSampleActionGroup" stepKey="removeSampleUrl"> | ||
<argument name="index" value="1"/> | ||
</actionGroup> | ||
<actionGroup ref="RemoveSampleActionGroup" stepKey="removeSampleFile"> | ||
<argument name="index" value="0"/> | ||
</actionGroup> | ||
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductAfterSamplesRemoved"/> | ||
|
||
<!-- Check if Samples are absent --> | ||
gabrieldagama marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<actionGroup ref="VerifySampleAbsentActionGroup" stepKey="verifySamplesAbsent"> | ||
<argument name="index" value="0"/> | ||
</actionGroup> | ||
</test> | ||
</tests> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -129,9 +129,6 @@ public function testExecuteNonDownloadable(): void | |
$this->entityMock->expects($this->once()) | ||
->method('getTypeId') | ||
->willReturn(Type::TYPE_DOWNLOADABLE . 'some'); | ||
$this->entityMock->expects($this->once()) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lets double check if we need to remove these assertions |
||
->method('getExtensionAttributes') | ||
->willReturn($this->productExtensionMock); | ||
$this->entityMock->expects($this->never()) | ||
->method('getSku'); | ||
$this->entityMock->expects($this->never()) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -326,10 +326,8 @@ public function testUpdateDownloadableProductData(): void | |
$response = $this->saveProduct($productData); | ||
|
||
$this->assertArrayHasKey(ProductInterface::EXTENSION_ATTRIBUTES_KEY, $response); | ||
$this->assertArrayHasKey(self::PRODUCT_SAMPLES, $response[ProductInterface::EXTENSION_ATTRIBUTES_KEY]); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lets double check if we need to remove these assertions |
||
$this->assertArrayHasKey(self::PRODUCT_LINKS, $response[ProductInterface::EXTENSION_ATTRIBUTES_KEY]); | ||
|
||
$this->assertCount(2, $response[ProductInterface::EXTENSION_ATTRIBUTES_KEY][self::PRODUCT_SAMPLES]); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lets double check if we need to remove these assertions |
||
$this->assertCount(2, $response[ProductInterface::EXTENSION_ATTRIBUTES_KEY][self::PRODUCT_LINKS]); | ||
} | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.