-
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.
Merge branch '2.4-develop' into jquery-upgrade
- Loading branch information
Showing
7 changed files
with
249 additions
and
16 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
38 changes: 38 additions & 0 deletions
38
...agento/ProductVideo/Test/Mftf/Test/AdminValidatePrivacyOnVimeoGetVideoInformationTest.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,38 @@ | ||
<?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="AdminValidatePrivacyOnVimeoGetVideoInformationTest"> | ||
<annotations> | ||
<features value="ProductVideo"/> | ||
<stories value="Add/remove images and videos for all product types and category"/> | ||
<title value="Admin validates Vimeo video privacy when getting video information"/> | ||
<description value="Admin should be able to see warning message when adding Vimeo video with restricted privacy privacy when getting video information"/> | ||
<severity value="AVERAGE"/> | ||
<testCaseId value="MC-42471"/> | ||
<useCaseId value="MC-42105"/> | ||
<group value="productVideo"/> | ||
</annotations> | ||
<before> | ||
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> | ||
</before> | ||
<after> | ||
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> | ||
</after> | ||
<actionGroup ref="AdminOpenNewProductFormPageActionGroup" stepKey="openNewProductPage"/> | ||
<actionGroup ref="AdminOpenProductVideoModalActionGroup" stepKey="openAddProductVideoModal"/> | ||
<actionGroup ref="AdminFillProductVideoFieldActionGroup" stepKey="fillVideoUrlField"> | ||
<argument name="input" value="{{AdminProductNewVideoSection.videoUrlTextField}}"/> | ||
<argument name="value" value="{{VimeoPrivateVideo.videoUrl}}"/> | ||
</actionGroup> | ||
<actionGroup ref="AdminGetVideoInformationActionGroup" stepKey="clickOnGetVideoInformation"/> | ||
<waitForElementVisible selector="{{AdminConfirmationModalSection.message}}" stepKey="waitForWarningMessage"/> | ||
<see selector="{{AdminConfirmationModalSection.message}}" userInput='Because of its privacy settings, this video cannot be played here.' stepKey="seeAdminWarningMessage"/> | ||
</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
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
102 changes: 102 additions & 0 deletions
102
dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestCollectRatesTest.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,102 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento\Quote\Api; | ||
|
||
use Magento\Framework\Webapi\Rest\Request; | ||
use Magento\Quote\Model\Quote; | ||
use Magento\Quote\Model\QuoteIdMaskFactory; | ||
use Magento\TestFramework\Helper\Bootstrap; | ||
use Magento\TestFramework\ObjectManager; | ||
use Magento\TestFramework\TestCase\WebapiAbstract; | ||
use Magento\Quote\Model\QuoteIdMask; | ||
|
||
/** | ||
* Class GuestCollectRatesTest checks that totals will be recollected properly with new shipping method | ||
*/ | ||
class GuestCollectRatesTest extends WebapiAbstract | ||
{ | ||
const SERVICE_VERSION = 'V1'; | ||
const SERVICE_NAME = 'quoteGuestCartTotalManagementV1'; | ||
const RESOURCE_PATH = '/V1/guest-carts/'; | ||
|
||
/** | ||
* @var ObjectManager | ||
*/ | ||
private $objectManager; | ||
|
||
/** | ||
* @var Quote | ||
*/ | ||
protected $quote; | ||
|
||
protected function setUp(): void | ||
{ | ||
$this->objectManager = Bootstrap::getObjectManager(); | ||
$this->quote = $this->objectManager->create(Quote::class); | ||
} | ||
|
||
/** | ||
* Checks that totals are properly recollected after changing shipping method | ||
* | ||
* @magentoApiDataFixture Magento/Checkout/_files/quote_with_shipping_method.php | ||
*/ | ||
public function testCollectRatesWithChangedShippingMethod() | ||
{ | ||
$this->quote->load('test_order_1', 'reserved_order_id'); | ||
$cartId = $this->quote->getId(); | ||
|
||
/** @var QuoteIdMask $quoteIdMask */ | ||
$quoteIdMask = $this->objectManager | ||
->create(QuoteIdMaskFactory::class) | ||
->create(); | ||
$quoteIdMask->load($cartId, 'quote_id'); | ||
|
||
$cartId = $quoteIdMask->getMaskedId(); | ||
$requestData = [ | ||
"shippingMethodCode" => "freeshipping", | ||
"shippingCarrierCode" => "freeshipping", | ||
"paymentMethod" => [ | ||
"method" => "checkmo", | ||
], | ||
]; | ||
|
||
if (TESTS_WEB_API_ADAPTER === self::ADAPTER_SOAP) { | ||
$requestData['cartId'] = $cartId; | ||
} | ||
|
||
$totals = $this->_webApiCall($this->getListServiceInfo($cartId), $requestData); | ||
$this->assertEquals(20, $totals['grand_total']); | ||
$this->assertEquals(0, $totals['shipping_amount']); | ||
|
||
$requestData['shippingMethodCode'] = 'flatrate'; | ||
$requestData['shippingCarrierCode'] = 'flatrate'; | ||
|
||
$totals = $this->_webApiCall($this->getListServiceInfo($cartId), $requestData); | ||
$this->assertEquals(30, $totals['grand_total']); | ||
$this->assertEquals(10, $totals['shipping_amount']); | ||
} | ||
|
||
/** | ||
* Service info | ||
* | ||
* @param int $cartId | ||
* @return array | ||
*/ | ||
protected function getListServiceInfo($cartId) | ||
{ | ||
return [ | ||
'rest' => [ | ||
'resourcePath' => self::RESOURCE_PATH . $cartId . '/collect-totals', | ||
'httpMethod' => Request::HTTP_METHOD_PUT, | ||
], | ||
'soap' => [ | ||
'service' => self::SERVICE_NAME, | ||
'serviceVersion' => self::SERVICE_VERSION, | ||
'operation' => 'quoteGuestCartTotalManagementV1CollectTotals', | ||
], | ||
]; | ||
} | ||
} |