Skip to content

Commit dd8208c

Browse files
committed
MC-5723: Flaky MFTF Map Tests - Google Maps Rate Limit Reached
1 parent ac1eae1 commit dd8208c

File tree

4 files changed

+4
-13
lines changed

4 files changed

+4
-13
lines changed

app/code/Magento/PageBuilder/Component/GoogleMapsApiKeyValidationContainer.php

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,26 +30,19 @@ class GoogleMapsApiKeyValidationContainer extends \Magento\Ui\Component\Containe
3030
*/
3131
private $scopeConfig;
3232

33-
/**
34-
* @var ApiKeyValidator
35-
*/
36-
private $apiKeyValidator;
37-
3833
/**
3934
* Constructor
4035
*
4136
* @param ContextInterface $context
4237
* @param UrlInterface $url
4338
* @param ScopeConfigInterface $scopeConfig
44-
* @param ApiKeyValidator $apiKeyValidator
4539
* @param array $components
4640
* @param array $data
4741
*/
4842
public function __construct(
4943
ContextInterface $context,
5044
UrlInterface $url,
5145
ScopeConfigInterface $scopeConfig,
52-
ApiKeyValidator $apiKeyValidator,
5346
array $components = [],
5447
array $data = []
5548
) {
@@ -60,7 +53,6 @@ public function __construct(
6053
);
6154
$this->url = $url;
6255
$this->scopeConfig = $scopeConfig;
63-
$this->apiKeyValidator = $apiKeyValidator;
6456
}
6557

6658
/**
@@ -73,8 +65,7 @@ public function prepare()
7365
parent::prepare();
7466
$config = $this->getData('config');
7567
$apiKey = $this->scopeConfig->getValue(self::GOOGLE_MAPS_API_KEY_PATH) ?: "";
76-
$response = $this->apiKeyValidator->validate($apiKey);
77-
if (!$response['success']) {
68+
if (trim($apiKey) == "") {
7869
$config['visible'] = true;
7970
}
8071

app/code/Magento/PageBuilder/Test/Mftf/Data/MapData.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<entity name="PageBuilderMapCommonData" type="pagebuilder__map_common_data">
2525
<data key="mapErrorTitleStorefront">Oops! Something went wrong.</data>
2626
<data key="mapErrorMessageStorefront">This page didn't load Google Maps correctly. See the JavaScript console for technical details.</data>
27-
<data key="mapErrorMessageStage">Enter API Key to use Google Maps</data>
27+
<data key="mapErrorMessageStage">Enter valid API Key to use Google Maps</data>
2828
</entity>
2929
<!-- Map Position -->
3030
<entity name="PageBuilderMapPositionDefaultProperty" type="pagebuilder_map_position_property">

app/code/Magento/PageBuilder/etc/adminhtml/system.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<field id="google_maps_api_key_validator" translate="button_label valid_label invalid_label" sortOrder="2011" showInDefault="1" showInWebsite="0" showInStore="0">
2828
<attribute type="button_label">Test Key</attribute>
2929
<attribute type="valid_label">Key is valid</attribute>
30-
<attribute type="invalid_label">Key is invalid. Try different key.</attribute>
30+
<attribute type="invalid_label">Key is invalid. Try a different key.</attribute>
3131
<attribute type="source_field">cms_pagebuilder_google_maps_api_key</attribute>
3232
<frontend_model>Magento\PageBuilder\Block\Adminhtml\System\Config\Form\Field\GoogleMapsApiKey</frontend_model>
3333
</field>

app/code/Magento/PageBuilder/view/base/web/js/utils/map.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ define([
5050
this.usePlaceholder = function (container) {
5151
var placeholder = document.createElement('div');
5252

53-
placeholder.innerHTML = $t('Enter API Key to use Google Maps');
53+
placeholder.innerHTML = $t('Enter valid API Key to use Google Maps');
5454
placeholder.classList.add('google-map-auth-failure-placeholder');
5555
container.innerHTML = '';
5656
container.appendChild(placeholder);

0 commit comments

Comments
 (0)