Skip to content

Commit e05cfbe

Browse files
authored
Merge pull request #4063 from magento-performance/MC-15779
[performance] MC-15779: Create coupon test functionality for our benchmark
2 parents 6cc245b + ccdaff5 commit e05cfbe

File tree

26 files changed

+1096
-61
lines changed

26 files changed

+1096
-61
lines changed

app/code/Magento/Catalog/view/frontend/templates/product/list/items.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ switch ($type = $block->getType()) {
169169
<?php if ($type == 'related' && $canItemsAddToCart): ?>
170170
<div class="block-actions">
171171
<?= /* @escapeNotVerified */ __('Check items to add to the cart or') ?>
172-
<button type="button" class="action select" role="select-all"><span><?= /* @escapeNotVerified */ __('select all') ?></span></button>
172+
<button type="button" class="action select" role="button"><span><?= /* @escapeNotVerified */ __('select all') ?></span></button>
173173
</div>
174174
<?php endif; ?>
175175
<div class="products wrapper grid products-grid products-<?= /* @escapeNotVerified */ $type ?>">

app/code/Magento/Catalog/view/frontend/web/js/related-products.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ define([
1717
relatedProductsField: '#related-products-field', // Hidden input field that stores related products.
1818
selectAllMessage: $.mage.__('select all'),
1919
unselectAllMessage: $.mage.__('unselect all'),
20-
selectAllLink: '[role="select-all"]',
20+
selectAllLink: '[role="button"]',
2121
elementsSelector: '.item.product'
2222
},
2323

app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingGuestInfoSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="CheckoutShippingGuestInfoSection">
12-
<element name="email" type="input" selector="#customer-email"/>
12+
<element name="email" type="input" selector="#checkout-customer-email"/>
1313
<element name="firstName" type="input" selector="input[name=firstname]"/>
1414
<element name="lastName" type="input" selector="input[name=lastname]"/>
1515
<element name="street" type="input" selector="input[name='street[0]']"/>

app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<element name="editAddressButton" type="button" selector=".action-edit-address" timeout="30"/>
1616
<element name="addressDropdown" type="select" selector="[name=billing_address_id]"/>
1717
<element name="newAddressButton" type="button" selector=".action-show-popup" timeout="30"/>
18-
<element name="email" type="input" selector="#customer-email"/>
18+
<element name="email" type="input" selector="#checkout-customer-email"/>
1919
<element name="firstName" type="input" selector="input[name=firstname]"/>
2020
<element name="lastName" type="input" selector="input[name=lastname]"/>
2121
<element name="company" type="input" selector="input[name=company]"/>

app/code/Magento/Checkout/view/frontend/templates/cart/item/default.phtml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -84,20 +84,20 @@ $canApplyMsrp = $helper->isShowBeforeOrderConfirm($product) && $helper->isMinima
8484
<?php endif; ?>
8585
<td class="col qty" data-th="<?= $block->escapeHtml(__('Qty')) ?>">
8686
<div class="field qty">
87-
<label class="label" for="cart-<?= /* @escapeNotVerified */ $_item->getId() ?>-qty">
88-
<span><?= /* @escapeNotVerified */ __('Qty') ?></span>
89-
</label>
9087
<div class="control qty">
91-
<input id="cart-<?= /* @escapeNotVerified */ $_item->getId() ?>-qty"
92-
name="cart[<?= /* @escapeNotVerified */ $_item->getId() ?>][qty]"
93-
data-cart-item-id="<?= $block->escapeHtml($_item->getSku()) ?>"
94-
value="<?= /* @escapeNotVerified */ $block->getQty() ?>"
95-
type="number"
96-
size="4"
97-
title="<?= $block->escapeHtml(__('Qty')) ?>"
98-
class="input-text qty"
99-
data-validate="{required:true,'validate-greater-than-zero':true}"
100-
data-role="cart-item-qty"/>
88+
<label for="cart-<?= /* @escapeNotVerified */ $_item->getId() ?>-qty">
89+
<span class="label"><?= /* @escapeNotVerified */ __('Qty') ?></span>
90+
<input id="cart-<?= /* @escapeNotVerified */ $_item->getId() ?>-qty"
91+
name="cart[<?= /* @escapeNotVerified */ $_item->getId() ?>][qty]"
92+
data-cart-item-id="<?= $block->escapeHtml($_item->getSku()) ?>"
93+
value="<?= /* @escapeNotVerified */ $block->getQty() ?>"
94+
type="number"
95+
size="4"
96+
title="<?= $block->escapeHtml(__('Qty')) ?>"
97+
class="input-text qty"
98+
data-validate="{required:true,'validate-greater-than-zero':true}"
99+
data-role="cart-item-qty"/>
100+
</label>
101101
</div>
102102
</div>
103103
</td>

app/code/Magento/Checkout/view/frontend/web/template/authentication.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@
3131
<div class="block block-customer-login"
3232
data-bind="attr: {'data-label': $t('or')}">
3333
<div class="block-title">
34-
<strong id="block-customer-login-heading"
35-
role="heading"
36-
aria-level="2"
37-
data-bind="i18n: 'Sign In'"></strong>
34+
<strong id="block-customer-login-heading-checkout"
35+
role="heading"
36+
aria-level="2"
37+
data-bind="i18n: 'Sign In'"></strong>
3838
</div>
3939
<!-- ko foreach: getRegion('messages') -->
4040
<!-- ko template: getTemplate() --><!-- /ko -->
4141
<!--/ko-->
42-
<div class="block-content" aria-labelledby="block-customer-login-heading">
42+
<div class="block-content" aria-labelledby="block-customer-login-heading-checkout">
4343
<form data-role="login"
4444
data-bind="submit:login"
4545
method="post">

app/code/Magento/Checkout/view/frontend/web/template/form/element/email.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
method="post">
1515
<fieldset id="customer-email-fieldset" class="fieldset" data-bind="blockLoader: isLoading">
1616
<div class="field required">
17-
<label class="label" for="customer-email">
17+
<label class="label" for="checkout-customer-email">
1818
<span data-bind="i18n: 'Email Address'"></span>
1919
</label>
2020
<div class="control _with-tooltip">
@@ -26,7 +26,7 @@
2626
mageInit: {'mage/trim-input':{}}"
2727
name="username"
2828
data-validate="{required:true, 'validate-email':true}"
29-
id="customer-email" />
29+
id="checkout-customer-email" />
3030
<!-- ko template: 'ui/form/element/helper/tooltip' --><!-- /ko -->
3131
<span class="note" data-bind="fadeVisible: isPasswordVisible() == false"><!-- ko i18n: 'You can create an account after checkout.'--><!-- /ko --></span>
3232
</div>

app/code/Magento/Checkout/view/frontend/web/template/summary/cart-items.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
-->
77
<div class="block items-in-cart" data-bind="mageInit: {'collapsible':{'openedState': 'active', 'active': isItemsBlockExpanded()}}">
88
<div class="title" data-role="title">
9-
<strong role="heading">
9+
<strong role="heading" aria-level="1">
1010
<translate args="maxCartItemsToDisplay" if="maxCartItemsToDisplay < getCartLineItemsCount()"/>
1111
<translate args="'of'" if="maxCartItemsToDisplay < getCartLineItemsCount()"/>
1212
<span data-bind="text: getCartLineItemsCount()"></span>

app/code/Magento/Elasticsearch/Model/ResourceModel/Fulltext/Collection/SearchCriteriaResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public function resolve(): SearchCriteria
7979
$this->builder->setPageSize($this->size);
8080
$searchCriteria = $this->builder->create();
8181
$searchCriteria->setRequestName($this->searchRequestName);
82-
$searchCriteria->setSortOrders($this->orders);
82+
$searchCriteria->setSortOrders(array_merge(['relevance' => 'DESC'], $this->orders));
8383
$searchCriteria->setCurrentPage($this->currentPage - 1);
8484

8585
return $searchCriteria;

app/code/Magento/Newsletter/view/frontend/templates/subscribe.phtml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,24 @@
1919
data-mage-init='{"validation": {"errorClass": "mage-error"}}'
2020
id="newsletter-validate-detail">
2121
<div class="field newsletter">
22-
<label class="label" for="newsletter"><span><?= $block->escapeHtml(__('Sign Up for Our Newsletter:')) ?></span></label>
2322
<div class="control">
24-
<input name="email" type="email" id="newsletter"
25-
placeholder="<?= $block->escapeHtml(__('Enter your email address')) ?>"
26-
data-mage-init='{"mage/trim-input":{}}'
27-
data-validate="{required:true, 'validate-email':true}"/>
23+
<label for="newsletter">
24+
<span class="label">
25+
<?= $block->escapeHtml(__('Sign Up for Our Newsletter:')) ?>
26+
</span>
27+
<input name="email" type="email" id="newsletter"
28+
placeholder="<?= $block->escapeHtml(__('Enter your email address')) ?>"
29+
data-mage-init='{"mage/trim-input":{}}'
30+
data-validate="{required:true, 'validate-email':true}"
31+
/>
32+
</label>
2833
</div>
2934
</div>
3035
<div class="actions">
31-
<button class="action subscribe primary" title="<?= $block->escapeHtmlAttr(__('Subscribe')) ?>" type="submit">
36+
<button class="action subscribe primary sr-only"
37+
title="<?= $block->escapeHtmlAttr(__('Subscribe')) ?>"
38+
type="submit"
39+
aria-label="Subscribe">
3240
<span><?= $block->escapeHtml(__('Subscribe')) ?></span>
3341
</button>
3442
</div>

app/code/Magento/Search/view/frontend/templates/form.mini.phtml

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,34 +16,41 @@ $helper = $this->helper(\Magento\Search\Helper\Data::class);
1616
<div class="block block-content">
1717
<form class="form minisearch" id="search_mini_form" action="<?= /* @escapeNotVerified */ $helper->getResultUrl() ?>" method="get">
1818
<div class="field search">
19-
<label class="label" for="search" data-role="minisearch-label">
20-
<span><?= /* @escapeNotVerified */ __('Search') ?></span>
21-
</label>
2219
<div class="control">
23-
<input id="search"
24-
data-mage-init='{"quickSearch":{
20+
<label for="search" data-role="minisearch-label">
21+
<span class="label">
22+
<?= /* @escapeNotVerified */ __('Search') ?>
23+
</span>
24+
<input
25+
aria-expanded="false"
26+
id="search"
27+
data-mage-init='{"quickSearch":{
2528
"formSelector":"#search_mini_form",
2629
"url":"<?= /* @escapeNotVerified */ $helper->getSuggestUrl()?>",
2730
"destinationSelector":"#search_autocomplete"}
28-
}'
29-
type="text"
30-
name="<?= /* @escapeNotVerified */ $helper->getQueryParamName() ?>"
31-
value="<?= /* @escapeNotVerified */ $helper->getEscapedQueryText() ?>"
32-
placeholder="<?= /* @escapeNotVerified */ __('Search entire store here...') ?>"
33-
class="input-text"
34-
maxlength="<?= /* @escapeNotVerified */ $helper->getMaxQueryLength() ?>"
35-
role="combobox"
36-
aria-haspopup="false"
37-
aria-autocomplete="both"
38-
autocomplete="off"/>
31+
}'
32+
type="text"
33+
name="<?= /* @escapeNotVerified */ $helper->getQueryParamName() ?>"
34+
value="<?= /* @escapeNotVerified */ $helper->getEscapedQueryText() ?>"
35+
placeholder="<?= /* @escapeNotVerified */ __('Search entire store here...') ?>"
36+
class="input-text"
37+
maxlength="<?= /* @escapeNotVerified */ $helper->getMaxQueryLength() ?>"
38+
role="combobox"
39+
aria-haspopup="false"
40+
aria-autocomplete="both"
41+
autocomplete="off"
42+
/>
43+
</label>
3944
<div id="search_autocomplete" class="search-autocomplete"></div>
4045
<?= $block->getChildHtml() ?>
4146
</div>
4247
</div>
4348
<div class="actions">
4449
<button type="submit"
45-
title="<?= $block->escapeHtml(__('Search')) ?>"
46-
class="action search">
50+
title="<?= $block->escapeHtml(__('Search')) ?>"
51+
class="action search"
52+
aria-label="Search"
53+
>
4754
<span><?= /* @escapeNotVerified */ __('Search') ?></span>
4855
</button>
4956
</div>

app/code/Magento/Search/view/frontend/web/js/form-mini.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ define([
7272
}.bind(this),
7373
exit: function () {
7474
this.isExpandable = false;
75-
this.element.removeAttr('aria-expanded');
7675
}.bind(this)
7776
});
7877

app/code/Magento/Theme/view/frontend/templates/html/header/logo.phtml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@
1212
?>
1313
<?php $storeName = $block->getThemeName() ? $block->getThemeName() : $block->getLogoAlt();?>
1414
<span data-action="toggle-nav" class="action nav-toggle"><span><?= /* @escapeNotVerified */ __('Toggle Nav') ?></span></span>
15-
<a class="logo" href="<?= $block->getUrl('') ?>" title="<?= /* @escapeNotVerified */ $storeName ?>">
15+
<a
16+
class="logo"
17+
href="<?= $block->getUrl('') ?>"
18+
title="<?= /* @escapeNotVerified */ $storeName ?>"
19+
aria-label="store logo">
1620
<img src="<?= /* @escapeNotVerified */ $block->getLogoSrc() ?>"
1721
title="<?= $block->escapeHtmlAttr($block->getLogoAlt()) ?>"
1822
alt="<?= $block->escapeHtmlAttr($block->getLogoAlt()) ?>"

app/code/Magento/Ui/view/frontend/web/templates/form/element/helper/tooltip.html

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,20 @@
1313
data-bind="attr: {href: tooltip.link}, mageInit: {'dropdown':{'activeClass': '_active'}}"></a>
1414
<!-- /ko -->
1515

16+
<span id="tooltip-label" class="label"><!-- ko i18n: 'Tooltip' --><!-- /ko --></span>
1617
<!-- ko if: (!tooltip.link)-->
17-
<span class="field-tooltip-action action-help"
18-
tabindex="0"
19-
data-toggle="dropdown"
20-
data-bind="mageInit: {'dropdown':{'activeClass': '_active'}}"></span>
18+
<span
19+
id="tooltip"
20+
class="field-tooltip-action action-help"
21+
tabindex="0"
22+
data-toggle="dropdown"
23+
data-bind="mageInit: {'dropdown':{'activeClass': '_active', 'parent': '.field-tooltip.toggle'}}"
24+
aria-labelledby="tooltip-label"
25+
>
26+
</span>
2127
<!-- /ko -->
2228

23-
<div class="field-tooltip-content"
29+
<div class="field-tooltip-content"
2430
data-target="dropdown" translate="tooltip.description">
2531
</div>
2632
</div>

app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/checkout/_tooltip.less

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@
5555
}
5656
}
5757

58+
.label {
59+
.lib-visually-hidden();
60+
}
61+
5862
.field-tooltip-action {
5963
.lib-icon-font(
6064
@checkout-tooltip-icon__content,

app/design/frontend/Magento/luma/Magento_Theme/layout/default_head_blocks.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
-->
88
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
99
<head>
10-
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no"/>
10+
<meta name="viewport" content="width=device-width, initial-scale=1"/>
1111
</head>
1212
</page>

dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Shipping.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class Shipping extends Form
102102
*
103103
* @var string
104104
*/
105-
private $emailError = '#customer-email-error';
105+
private $emailError = '#checkout-customer-email-error';
106106

107107
/**
108108
* Get email error.

dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Shipping.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<mapping strict="0">
99
<fields>
1010
<email>
11-
<selector>#customer-email</selector>
11+
<selector>#checkout-customer-email</selector>
1212
</email>
1313
<firstname />
1414
<lastname />

0 commit comments

Comments
 (0)