-
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
Open
omaxmo
wants to merge
12
commits into
magento:2.4-develop
Choose a base branch
from
omaxmo:downloadable-product-samples-delete-fix
base: 2.4-develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
5115368
remove samples link product downloadable
omaxmo eb9bcc1
remove variable
omaxmo 9e0e86e
Unit test fix
engcom-Hotel d13aa48
API test fix
engcom-Hotel 3817a8a
Merge branch '2.4-develop' into downloadable-product-samples-delete-fix
engcom-Hotel 8f7773c
magento/magento2#31887: fix Can't remove samples link product downloa…
engcom-Foxtrot 8372d21
Merge branch '2.4-develop' into downloadable-product-samples-delete-fix
engcom-Foxtrot 7651b1a
magento/magento2#32100: Admin login issue fix - MFTF update.
engcom-Foxtrot ffb9295
Merge remote-tracking branch 'omaxmo/downloadable-product-samples-del…
engcom-Foxtrot 1abd820
Apply suggestions from code review
gabrieldagama 2ea8e8c
Merge branch '2.4-develop' into downloadable-product-samples-delete-fix
ba36d39
Merge remote-tracking branch 'magento/2.4-develop' into downloadable-…
engcom-Charlie File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
22 changes: 22 additions & 0 deletions
22
app/code/Magento/Downloadable/Test/Mftf/ActionGroup/RemoveSampleActionGroup.xml
This file contains hidden or 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,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> |
21 changes: 21 additions & 0 deletions
21
app/code/Magento/Downloadable/Test/Mftf/ActionGroup/VerifySampleAbsentActionGroup.xml
This file contains hidden or 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,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> |
21 changes: 21 additions & 0 deletions
21
app/code/Magento/Downloadable/Test/Mftf/ActionGroup/VerifySamplePresentActionGroup.xml
This file contains hidden or 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,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> |
This file contains hidden or 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
72 changes: 72 additions & 0 deletions
72
app/code/Magento/Downloadable/Test/Mftf/Test/AdminDeleteDownloadableProductSampleTest.xml
This file contains hidden or 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,72 @@ | ||
<?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> | ||
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="amOnProductGridPage"/> | ||
<actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="createProduct"> | ||
<argument name="productType" value="downloadable"/> | ||
</actionGroup> | ||
<actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillDownloadableProductForm"> | ||
<argument name="product" value="DownloadableProduct"/> | ||
</actionGroup> | ||
<searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" | ||
parameterArray="[$$createCategory.name$$]" stepKey="fillCategory"/> | ||
<actionGroup ref="AdminAddDownloadableLinkInformationActionGroup" stepKey="addDownloadableLinkInformation"/> | ||
<checkOption selector="{{AdminProductDownloadableSection.isLinksPurchasedSeparately}}" | ||
stepKey="checkOptionPurchaseSeparately"/> | ||
<actionGroup ref="AddDownloadableProductLinkWithMaxDownloadsActionGroup" stepKey="addDownloadableProductLink"> | ||
<argument name="link" value="downloadableLinkWithMaxDownloads"/> | ||
</actionGroup> | ||
<actionGroup ref="AddDownloadableSampleFileActionGroup" stepKey="addDownloadSampleFile"> | ||
<argument name="sample" value="downloadableSampleFile"/> | ||
</actionGroup> | ||
<actionGroup ref="AddDownloadableSampleUrlActionGroup" stepKey="addDownloadableSampleUrl"> | ||
<argument name="sample" value="downloadableSampleUrl"/> | ||
</actionGroup> | ||
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> | ||
<actionGroup ref="VerifySamplePresentActionGroup" stepKey="verifySampleFilePresent"> | ||
<argument name="index" value="0"/> | ||
</actionGroup> | ||
<actionGroup ref="VerifySamplePresentActionGroup" stepKey="verifySampleUrlPresent"> | ||
<argument name="index" value="1"/> | ||
</actionGroup> | ||
<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"/> | ||
<actionGroup ref="VerifySampleAbsentActionGroup" stepKey="verifySamplesAbsent"> | ||
<argument name="index" value="0"/> | ||
</actionGroup> | ||
</test> | ||
</tests> |
This file contains hidden or 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 hidden or 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 |
---|---|---|
|
@@ -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]); | ||
} | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets double check if we need to remove these assertions