-
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.
🔃 [Magento Community Engineering] Community Contributions - 2.4-develop
Accepted Community Pull Requests: - #29799: Add elasticsearch params to integration tests config (by @ihor-sviziev) - #29634: [MFTF] Added some ActionGroups to Analytics module (by @Usik2203) - #29348: [MFTF] Test scenario for "Apply shopping cart rule to a single bundle item" (#28921) (by @zhartaunik) - #28413: Fix Downloadable product after refund (by @ProkopovVitaliy) - #27609: Test coverage for PR #27357 (E-mail templates) (by @lbajsarowicz) - #27579: Fix #27523: throw informative errors in setup:db:generate-patch (by @korostii) Fixed GitHub Issues: - #29648: [Issue] [MFTF] Added some ActionGroups to Analytics module (reported by @m2-assistant[bot]) has been fixed in #29634 by @Usik2203 in 2.4-develop branch Related commits: 1. f54fd86 2. 1492668 3. 59d5d32 4. 8c2291f 5. e25fc55 - #28921: Apply shopping cart rule to a single bundle item (reported by @MilanFrajt) has been fixed in #29348 by @zhartaunik in 2.4-develop branch Related commits: 1. e6aca3b 2. 7abc82f - #28388: Downloadable product is available in My Download Products tab after it has been partially refunded (reported by @YaninaPrudnikova) has been fixed in #28413 by @ProkopovVitaliy in 2.4-develop branch Related commits: 1. a6f460d 2. 9a83830 3. 96c9d54 4. 59cf9f7 5. c6c3231 6. eafdb17 7. 92fd06b 8. 1f7eace 9. db84d3a 10. d0a0962 11. aea9276 12. 1be2cd7 13. dee9b16 14. a49709f 15. 8023f42 16. 9e31246 17. d91b305 18. 62e4866 19. 97df424 20. 2d58988 21. 87d8984 - #27523: CLI Patch Generator: Lack of information what path cannot be created (reported by @lbajsarowicz) has been fixed in #27579 by @korostii in 2.4-develop branch Related commits: 1. 1e8e825 2. 1dd5290 3. c1d8fef 4. a74f8fe 5. f48cd50 6. 2bc691a 7. 8991733 8. 347602f 9. 75bb2c3 10. 7d316d4
- Loading branch information
Showing
21 changed files
with
701 additions
and
53 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
...agento/Analytics/Test/Mftf/ActionGroup/AdminOpenConfigGeneralAnalyticsPageActionGroup.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,19 @@ | ||
<?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="AdminOpenConfigGeneralAnalyticsPageActionGroup"> | ||
<annotations> | ||
<description>Open Config General Analytics Page.</description> | ||
</annotations> | ||
|
||
<amOnPage url="{{AdminConfigGeneralAnalyticsPage.url}}" stepKey="amOnAdminConfig"/> | ||
<waitForPageLoad stepKey="waitPageLoad"/> | ||
</actionGroup> | ||
</actionGroups> |
20 changes: 20 additions & 0 deletions
20
...agento/Analytics/Test/Mftf/ActionGroup/AssertAdminAdvancedReportingPageUrlActionGroup.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,20 @@ | ||
<?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="AssertAdminAdvancedReportingPageUrlActionGroup"> | ||
<annotations> | ||
<description>Assert admin advanced reporting page url.</description> | ||
</annotations> | ||
|
||
<switchToNextTab stepKey="switchToNewTab"/> | ||
<waitForPageLoad stepKey="waitForAdvancedReportingPageLoad"/> | ||
<seeInCurrentUrl url="advancedreporting.rjmetrics.com/report" stepKey="seeAssertAdvancedReportingPageUrl"/> | ||
</actionGroup> | ||
</actionGroups> |
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
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
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
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
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
119 changes: 119 additions & 0 deletions
119
app/code/Magento/Developer/Test/Unit/Console/Command/GeneratePatchCommandTest.php
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,119 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Magento\Developer\Test\Unit\Console\Command; | ||
|
||
use Magento\Developer\Console\Command\GeneratePatchCommand; | ||
use Magento\Framework\Component\ComponentRegistrar; | ||
use Magento\Framework\Filesystem\Directory\Read; | ||
use Magento\Framework\Filesystem\Directory\ReadFactory; | ||
use Magento\Framework\Filesystem\Directory\Write; | ||
use Magento\Framework\Filesystem\Directory\WriteFactory; | ||
use Magento\Framework\Filesystem\DirectoryList; | ||
use PHPUnit\Framework\MockObject\MockObject; | ||
use PHPUnit\Framework\TestCase; | ||
use Symfony\Component\Console\Tester\CommandTester; | ||
|
||
class GeneratePatchCommandTest extends TestCase | ||
{ | ||
/** | ||
* @var ComponentRegistrar|MockObject | ||
*/ | ||
private $componentRegistrarMock; | ||
|
||
/** | ||
* @var DirectoryList|MockObject | ||
*/ | ||
private $directoryListMock; | ||
|
||
/** | ||
* @var ReadFactory|MockObject | ||
*/ | ||
private $readFactoryMock; | ||
|
||
/** | ||
* @var WriteFactory|MockObject | ||
*/ | ||
private $writeFactoryMock; | ||
|
||
/** | ||
* @var GeneratePatchCommand|MockObject | ||
*/ | ||
private $command; | ||
|
||
protected function setUp(): void | ||
{ | ||
$this->componentRegistrarMock = $this->createMock(ComponentRegistrar::class); | ||
$this->directoryListMock = $this->createMock(DirectoryList::class); | ||
$this->readFactoryMock = $this->createMock(ReadFactory::class); | ||
$this->writeFactoryMock = $this->createMock(WriteFactory::class); | ||
|
||
$this->command = new GeneratePatchCommand( | ||
$this->componentRegistrarMock, | ||
$this->directoryListMock, | ||
$this->readFactoryMock, | ||
$this->writeFactoryMock | ||
); | ||
} | ||
|
||
public function testExecute() | ||
{ | ||
$this->componentRegistrarMock->expects($this->once()) | ||
->method('getPath') | ||
->with('module', 'Vendor_Module') | ||
->willReturn('/long/path/to/Vendor/Module'); | ||
|
||
$read = $this->createMock(Read::class); | ||
$read->expects($this->at(0)) | ||
->method('readFile') | ||
->with('patch_template.php.dist') | ||
->willReturn('something'); | ||
$this->readFactoryMock->method('create')->willReturn($read); | ||
|
||
$write = $this->createMock(Write::class); | ||
$write->expects($this->once())->method('writeFile'); | ||
$this->writeFactoryMock->method('create')->willReturn($write); | ||
|
||
$this->directoryListMock->expects($this->once())->method('getRoot')->willReturn('/some/path'); | ||
|
||
$commandTester = new CommandTester($this->command); | ||
$commandTester->execute( | ||
[ | ||
GeneratePatchCommand::MODULE_NAME => 'Vendor_Module', | ||
GeneratePatchCommand::INPUT_KEY_PATCH_NAME => 'SomePatch' | ||
] | ||
); | ||
$this->assertStringContainsString('successfully generated', $commandTester->getDisplay()); | ||
} | ||
|
||
public function testWrongParameter() | ||
{ | ||
$this->expectExceptionMessage('Not enough arguments'); | ||
$this->expectException(\RuntimeException::class); | ||
|
||
$commandTester = new CommandTester($this->command); | ||
$commandTester->execute([]); | ||
} | ||
|
||
public function testBadModule() | ||
{ | ||
$this->componentRegistrarMock->expects($this->once()) | ||
->method('getPath') | ||
->with('module', 'Fake_Module') | ||
->willReturn(null); | ||
|
||
$this->expectExceptionMessage('Cannot find a registered module with name "Fake_Module"'); | ||
$this->expectException(\InvalidArgumentException::class); | ||
|
||
$commandTester = new CommandTester($this->command); | ||
$commandTester->execute( | ||
[ | ||
GeneratePatchCommand::MODULE_NAME => 'Fake_Module', | ||
GeneratePatchCommand::INPUT_KEY_PATCH_NAME => 'SomePatch' | ||
] | ||
); | ||
} | ||
} |
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
26 changes: 26 additions & 0 deletions
26
...tf/ActionGroup/StorefrontNotAssertDownloadableProductLinkInCustomerAccountActionGroup.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,26 @@ | ||
<?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="StorefrontNotAssertDownloadableProductLinkInCustomerAccountActionGroup"> | ||
<annotations> | ||
<description>Goes to the Storefront Customer Dashboard page. Clicks on 'My Downloadable Products'. Validates that the provided Downloadable Product is present and Downloadable link not exist.</description> | ||
</annotations> | ||
<arguments> | ||
<argument name="product"/> | ||
</arguments> | ||
|
||
<amOnPage url="{{StorefrontCustomerDashboardPage.url}}" stepKey="goToMyAccountPage"/> | ||
<click selector="{{StorefrontCustomerSidebarSection.sidebarTab('My Downloadable Products')}}" stepKey="clickDownloadableProducts"/> | ||
<waitForPageLoad stepKey="waitForDownloadableProductsPageLoad"/> | ||
<seeElement selector="{{StorefrontCustomerDownloadableProductsSection.productName(product.name)}}" stepKey="seeStorefrontDownloadableProductsProductName"/> | ||
<dontSeeElement selector="{{StorefrontCustomerDownloadableProductsSection.downloadableLink}}" stepKey="dontSeeStorefrontMyDownloadableProductsLink"/> | ||
|
||
</actionGroup> | ||
</actionGroups> |
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
Oops, something went wrong.