File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ class CustomOptions extends Form
58
58
*
59
59
* @var string
60
60
*/
61
- protected $ maxCharacters = './/div[@class="control"]/p[contains(@class, "note")]/strong ' ;
61
+ protected $ maxCharacters = './/div[@class="control"]/p[contains(@class, "note")] ' ;
62
62
63
63
/**
64
64
* Selector for label of option value element
@@ -220,13 +220,19 @@ public function isJsMessageVisible($customOptionTitle)
220
220
protected function getFieldData (SimpleElement $ option )
221
221
{
222
222
$ price = $ this ->getOptionPriceNotice ($ option );
223
- $ maxCharacters = $ option ->find ($ this ->maxCharacters , Locator::SELECTOR_XPATH );
223
+ $ maxCharactersElement = $ option ->find ($ this ->maxCharacters , Locator::SELECTOR_XPATH );
224
+
225
+ $ maxCharacters = null ;
226
+ if ($ maxCharactersElement ->isVisible ()) {
227
+ preg_match ('/\s([0-9]+)\s/ ' , $ maxCharactersElement ->getText (), $ match );
228
+ $ maxCharacters = isset ($ match [1 ]) ? $ match [1 ] : $ maxCharactersElement ->getText ();
229
+ }
224
230
225
231
return [
226
232
'options ' => [
227
233
[
228
234
'price ' => floatval ($ price ),
229
- 'max_characters ' => $ maxCharacters-> isVisible () ? $ maxCharacters -> getText () : null ,
235
+ 'max_characters ' => $ maxCharacters ,
230
236
],
231
237
]
232
238
];
You can’t perform that action at this time.
0 commit comments