Skip to content

Commit

Permalink
Merge pull request #3429 from magento-borg/BugFixPR
Browse files Browse the repository at this point in the history
[2.3-develop] Bug Fixes
  • Loading branch information
joanhe authored Nov 9, 2018
2 parents b252ca0 + d0da0e4 commit 6481cec
Show file tree
Hide file tree
Showing 12 changed files with 132 additions and 77 deletions.
2 changes: 1 addition & 1 deletion app/code/Magento/Customer/etc/db_schema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@
<column xsi:type="int" name="customer_id" padding="11" unsigned="false" nullable="true" identity="false"
comment="Customer Id"/>
<column xsi:type="varchar" name="session_id" nullable="true" length="64" comment="Session ID"/>
<column xsi:type="timestamp" name="last_visit_at" on_update="true" nullable="true" default="CURRENT_TIMESTAMP"
<column xsi:type="timestamp" name="last_visit_at" on_update="true" nullable="false" default="CURRENT_TIMESTAMP"
comment="Last Visit Time"/>
<constraint xsi:type="primary" referenceId="PRIMARY">
<column name="visitor_id"/>
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Integration/etc/db_schema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
comment="User type (admin or customer)"/>
<column xsi:type="smallint" name="failures_count" padding="5" unsigned="true" nullable="true" identity="false"
default="0" comment="Number of failed authentication attempts in a row"/>
<column xsi:type="timestamp" name="lock_expires_at" on_update="true" nullable="true" default="CURRENT_TIMESTAMP"
<column xsi:type="timestamp" name="lock_expires_at" on_update="true" nullable="false" default="CURRENT_TIMESTAMP"
comment="Lock expiration time"/>
<constraint xsi:type="primary" referenceId="PRIMARY">
<column name="log_id"/>
Expand Down
106 changes: 53 additions & 53 deletions app/code/Magento/Sales/etc/db_schema.xml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
-->
<mapping strict="0">
<fields>
<qty />
<checkbox>
<selector>div[contains(@class,"field choice") and label[contains(.,"%product_name%")]]//input</selector>
<strategy>xpath</strategy>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\Checkout\Test\Constraint;

use Magento\Checkout\Test\Fixture\Cart;
use Magento\Checkout\Test\Page\CheckoutCart;
use Magento\Mtf\Client\BrowserInterface;
use Magento\Mtf\Constraint\AbstractConstraint;
Expand All @@ -30,8 +30,10 @@ class AssertCartIsEmpty extends AbstractConstraint
* @param BrowserInterface $browser
* @return void
*/
public function processAssert(CheckoutCart $checkoutCart, BrowserInterface $browser)
{
public function processAssert(
CheckoutCart $checkoutCart,
BrowserInterface $browser
): void {
$checkoutCart->open();
$cartEmptyBlock = $checkoutCart->getCartEmptyBlock();

Expand All @@ -42,10 +44,12 @@ public function processAssert(CheckoutCart $checkoutCart, BrowserInterface $brow
);

$cartEmptyBlock->clickLinkToMainPage();
\PHPUnit\Framework\Assert::assertEquals(
$this->assertUrlEqual(
$_ENV['app_frontend_url'],
$browser->getUrl(),
'Wrong link to main page on empty cart page.'
true,
'Wrong link to main page on empty cart page: expected - ' . $_ENV['app_frontend_url']
. ', actual - ' . $browser->getUrl()
);
}

Expand All @@ -58,4 +62,31 @@ public function toString()
{
return 'Shopping Cart is empty.';
}

/**
* Asserts that two urls are equal
*
* @param string $expectedUrl
* @param string $actualUrl
* @param bool $ignoreScheme
* @param string $message
* @return void
*/
private function assertUrlEqual(
string $expectedUrl,
string $actualUrl,
bool $ignoreScheme = false,
string $message = ''
): void {
$urlArray1 = parse_url($expectedUrl);
$urlArray2 = parse_url($actualUrl);
if ($ignoreScheme) {
unset($urlArray1['scheme']);
unset($urlArray2['scheme']);
}
\PHPUnit\Framework\Assert::assertTrue(
$urlArray1 === $urlArray2,
$message
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
<constraint name="Magento\Shipping\Test\Constraint\AssertShipmentSuccessCreateMessage" />
</variation>
<variation name="OnePageCheckoutUsingRegisterLink" summary="Customer is redirected to checkout on login if guest is disabled, flow with registration new Customer" ticketId="MAGETWO-49917">
<data name="issue" xsi:type="string">MAGETWO-59816: Redirect works improperly in a browser incognito mode</data>
<data name="tag" xsi:type="string">severity:S1</data>
<data name="products/0" xsi:type="string">catalogProductSimple::default</data>
<data name="customer/dataset" xsi:type="string">register_customer</data>
Expand Down Expand Up @@ -57,7 +56,7 @@
<constraint name="Magento\Sales\Test\Constraint\AssertOrderGrandTotal" />
</variation>
<variation name="OnePageCheckoutTestVariation2" summary="US customer during checkout using coupon for all customer groups">
<data name="tag" xsi:type="string">stable:no, severity:S0</data>
<data name="tag" xsi:type="string">severity:S0</data>
<data name="products/0" xsi:type="string">catalogProductSimple::default</data>
<data name="salesRule" xsi:type="string">active_sales_rule_for_all_groups</data>
<data name="customer/dataset" xsi:type="string">default</data>
Expand All @@ -79,7 +78,7 @@
<constraint name="Magento\Sales\Test\Constraint\AssertOrderGrandTotal" />
</variation>
<variation name="OnePageCheckoutTestVariation3" summary="Checkout as UK guest with simple product" ticketId="MAGETWO-42603, MAGETWO-43282, MAGETWO-43318">
<data name="tag" xsi:type="string">severity:S1, stable:no</data>
<data name="tag" xsi:type="string">severity:S1</data>
<data name="products/0" xsi:type="string">catalogProductSimple::product_with_qty_25</data>
<data name="expectedQty/0" xsi:type="string">0</data>
<data name="expectedStockStatus/0" xsi:type="string">out of stock</data>
Expand All @@ -92,7 +91,7 @@
<item name="grandTotal" xsi:type="string">375.00</item>
</data>
<data name="payment/method" xsi:type="string">banktransfer</data>
<data name="status" xsi:type="string">Precessing</data>
<data name="status" xsi:type="string">Processing</data>
<data name="orderButtonsAvailable" xsi:type="string">Back, Send Email, Cancel, Hold, Invoice, Edit</data>
<data name="configData" xsi:type="string">banktransfer_specificcountry_gb, can_subtract_and_can_back_in_stock</data>
<constraint name="Magento\Shipping\Test\Constraint\AssertShipmentSuccessCreateMessage" />
Expand All @@ -102,10 +101,8 @@
<constraint name="Magento\Sales\Test\Constraint\AssertOrderStatusIsCorrect" />
<constraint name="Magento\Sales\Test\Constraint\AssertOrderButtonsAvailable" />
<constraint name="Magento\Sales\Test\Constraint\AssertOrderGrandTotal" />
<data name="issue" xsi:type="string">MAGETWO-66737: Magento\Checkout\Test\TestCase\OnePageCheckoutTest with OnePageCheckoutTestVariation3 and 4 is not stable</data>
</variation>
<variation name="OnePageCheckoutTestVariation4" summary="One Page Checkout Products with Special Prices" ticketId="MAGETWO-12429">
<data name="issue" xsi:type="string">MAGETWO-95659: Fix and Unskip MTF OnePageCheckoutOfflinePaymentMethodsTest</data>
<data name="tag" xsi:type="string">test_type:acceptance_test, test_type:extended_acceptance_test, severity:S0</data>
<data name="products/0" xsi:type="string">catalogProductSimple::product_with_special_price</data>
<data name="products/1" xsi:type="string">configurableProduct::product_with_special_price</data>
Expand Down Expand Up @@ -211,7 +208,7 @@
<constraint name="Magento\Sales\Test\Constraint\AssertOrderGrandTotal" />
</variation>
<variation name="OnePageCheckoutTestVariation9" summary="One Page Checkout Products with different shipping/billing address and Tier Prices" ticketId="MAGETWO-42604">
<data name="tag" xsi:type="string">stable:no, severity:S1</data>
<data name="tag" xsi:type="string">severity:S1</data>
<data name="products/0" xsi:type="string">catalogProductSimple::simple_with_tier_price_and_order_qty_3</data>
<data name="customer/dataset" xsi:type="string">default</data>
<data name="checkoutMethod" xsi:type="string">login</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd">
<testCase name="Magento\Checkout\Test\TestCase\OnePageCheckoutTest" summary="OnePageCheckout within Offline Payment Methods" ticketId="MAGETWO-27485">
<variation name="OnePageCheckoutUsingSingInLink" summary="Login during checkout using 'Sign In' link" ticketId="MAGETWO-42547">
<variation name="OnePageCheckoutUsingSignInLink" summary="Login during checkout using 'Sign In' link" ticketId="MAGETWO-42547">
<data name="tag" xsi:type="string">severity:S1</data>
<data name="products/0" xsi:type="string">catalogProductSimple::default</data>
<data name="customer/dataset" xsi:type="string">customer_UK_US_addresses</data>
Expand Down Expand Up @@ -49,10 +49,6 @@
<constraint name="Magento\Checkout\Test\Constraint\AssertOrderSuccessPlacedMessage" />
<constraint name="Magento\Sales\Test\Constraint\AssertOrderGrandTotal" />
<constraint name="Magento\Sales\Test\Constraint\AssertOrderAddresses" />
<!-- MAGETWO-94169 -->
<data name="tag" xsi:type="string">stable:no</data>
<data name="issue" xsi:type="string">MAGETWO-94169: [MTF] - OnePageCheckoutUsingNonDefaultAddress_0 fails on 2.3-develop</data>
<!-- MAGETWO-94169 -->
</variation>
<variation name="OnePageCheckoutUsingNewAddress" summary="Checkout as Customer using New address" ticketId="MAGETWO-42601">
<data name="tag" xsi:type="string">severity:S1</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,21 @@ class SelectCheckoutMethodStep implements TestStepInterface
*/
private $customerAccountCreatePage;

/**
* Proceed to checkout from minicart step
*
* @var proceedToCheckoutFromMiniShoppingCartStep
*/
private $proceedToCheckoutFromMiniShoppingCartStep;

/**
* @constructor
* @param CheckoutOnepage $checkoutOnepage
* @param CustomerAccountCreate $customerAccountCreatePage
* @param Customer $customer
* @param LogoutCustomerOnFrontendStep $logoutCustomerOnFrontend
* @param ClickProceedToCheckoutStep $clickProceedToCheckoutStep
* @param ProceedToCheckoutFromMiniShoppingCartStep $proceedToCheckoutFromMiniShoppingCartStep
* @param string $checkoutMethod
*/
public function __construct(
Expand All @@ -74,6 +82,7 @@ public function __construct(
Customer $customer,
LogoutCustomerOnFrontendStep $logoutCustomerOnFrontend,
ClickProceedToCheckoutStep $clickProceedToCheckoutStep,
ProceedToCheckoutFromMiniShoppingCartStep $proceedToCheckoutFromMiniShoppingCartStep,
$checkoutMethod
) {
$this->checkoutOnepage = $checkoutOnepage;
Expand All @@ -82,6 +91,7 @@ public function __construct(
$this->logoutCustomerOnFrontend = $logoutCustomerOnFrontend;
$this->clickProceedToCheckoutStep = $clickProceedToCheckoutStep;
$this->checkoutMethod = $checkoutMethod;
$this->proceedToCheckoutFromMiniShoppingCartStep = $proceedToCheckoutFromMiniShoppingCartStep;
}

/**
Expand Down Expand Up @@ -129,6 +139,7 @@ private function processRegister()
if ($this->checkoutMethod === 'register_before_checkout') {
$this->checkoutOnepage->getAuthenticationPopupBlock()->createAccount();
$this->customerAccountCreatePage->getRegisterForm()->registerCustomer($this->customer);
$this->proceedToCheckoutFromMiniShoppingCartStep->run();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
-->
<mapping strict="0">
<fields>
<qty />
<attribute>
<selector>//div[@class="product-options"]//label[.="%s"]//following-sibling::*//select</selector>
<strategy>xpath</strategy>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
-->
<mapping strict="0">
<fields>
<qty />
<link>
<selector>//*[@id="downloadable-links-list"]/*[contains(.,"%link_name%")]//input</selector>
<strategy>xpath</strategy>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd">
<testCase name="Magento\Reports\Test\TestCase\ProductsInCartReportEntityTest" summary="Products In Cart Report" ticketId="MAGETWO-27952">
<variation name="ProductsInCartReportEntityVariation1">
<data name="issue" xsi:type="string">MQE-1160</data>
<data name="product/dataset" xsi:type="string">default</data>
<data name="carts" xsi:type="string">1</data>
<data name="isGuest" xsi:type="string">0</data>
<constraint name="Magento\Reports\Test\Constraint\AssertProductInCartResult" />
</variation>
<variation name="ProductsInCartReportEntityVariation2">
<data name="issue" xsi:type="string">MQE-1160</data>
<data name="product/dataset" xsi:type="string">default</data>
<data name="carts" xsi:type="string">2</data>
<data name="isGuest" xsi:type="string">1</data>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);


namespace Magento\Integration\Block\Adminhtml\System\Config;

class OauthSectionTest extends \Magento\TestFramework\TestCase\AbstractBackendController
{
/**
* Checks that OAuth Section in the system config is loaded
*/
public function testOAuthSection()
{
$this->dispatch('backend/admin/system_config/edit/section/oauth/');
$body = $this->getResponse()->getBody();
$this->assertContains('id="oauth_access_token_lifetime-head"', $body);
$this->assertContains('id="oauth_cleanup-head"', $body);
$this->assertContains('id="oauth_consumer-head"', $body);
$this->assertContains('id="oauth_authentication_lock-head"', $body);
}
}

0 comments on commit 6481cec

Please sign in to comment.