Skip to content

Commit 96296cf

Browse files
committed
Merge branch 'develop' of https://github.com/magento-l3/magento2-page-builder into ACP2E-2606
2 parents 9e45c4a + 62c7f98 commit 96296cf

File tree

37 files changed

+171
-51
lines changed

37 files changed

+171
-51
lines changed

app/code/Magento/PageBuilder/Model/Dom/Document.php

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
namespace Magento\PageBuilder\Model\Dom;
99

1010
use DOMNode;
11-
use Gt\Dom\Document as GtDomDocument;
11+
use Magento\PageBuilder\Model\Dom\DomDocument;
1212
use Magento\Framework\ObjectManagerInterface;
1313
use Magento\PageBuilder\Model\Dom\Adapter\DocumentFragmentInterface;
1414
use Magento\PageBuilder\Model\Dom\Adapter\DocumentInterface;
@@ -26,21 +26,29 @@ class Document implements DocumentInterface
2626
protected $objectManager;
2727

2828
/**
29-
* @var GtDomDocument
29+
* @var DOMDocument
3030
*/
3131
protected $document;
3232

3333
/**
3434
* Document constructor.
3535
* @param ObjectManagerInterface $objectManager
36-
* @param string $document
36+
* @param string $characterSet
37+
* @param string $contentType
3738
*/
3839
public function __construct(
3940
ObjectManagerInterface $objectManager,
40-
string $document = ""
41+
string $characterSet,
42+
string $contentType
4143
) {
4244
$this->objectManager = $objectManager;
43-
$this->document = $this->objectManager->create(GtDomDocument::class, [ 'document' => $document ]);
45+
$this->document = $this->objectManager->create(
46+
DomDocument::class,
47+
[
48+
'characterSet' => $characterSet,
49+
'contentType' => $contentType
50+
]
51+
);
4452
}
4553

4654
/**
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\PageBuilder\Model\Dom;
9+
10+
use Gt\Dom\Document as GtDomDocument;
11+
12+
/**
13+
* PhpGt DOM Document wrapper.
14+
*/
15+
class DomDocument extends GtDomDocument
16+
{
17+
}

app/code/Magento/PageBuilder/Model/Dom/HtmlCollection.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
use ArrayAccess;
1111
use Countable;
12-
use Gt\Dom\HTMLCollection as GtDomHTMLCollection;
12+
use Gt\Dom\NodeList as GtDomNodeList;
1313
use Iterator;
1414
use Magento\Framework\ObjectManagerInterface;
1515
use Magento\PageBuilder\Model\Dom\Adapter\ElementInterface;
@@ -26,19 +26,19 @@ class HtmlCollection implements Iterator, ArrayAccess, Countable, HtmlCollection
2626
private $objectManager;
2727

2828
/**
29-
* @var GtDomHTMLCollection
29+
* @var GtDomNodeList
3030
*/
3131
private $collection;
3232

3333
/**
3434
* HtmlCollection constructor.
3535
*
3636
* @param ObjectManagerInterface $objectManager
37-
* @param GtDomHTMLCollection $collection
37+
* @param GtDomNodeList $collection
3838
*/
3939
public function __construct(
4040
ObjectManagerInterface $objectManager,
41-
GtDomHTMLCollection $collection
41+
GtDomNodeList $collection
4242
) {
4343
$this->objectManager = $objectManager;
4444
$this->collection = $collection;

app/code/Magento/PageBuilder/Model/Dom/HtmlDocument.php

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,23 @@ class HtmlDocument extends Document implements HtmlDocumentInterface
2121
* HtmlDocument constructor.
2222
* @param ObjectManagerInterface $objectManager
2323
* @param string $document
24+
* @param string $characterSet
25+
* @param string $contentType
2426
*/
2527
public function __construct(
2628
ObjectManagerInterface $objectManager,
27-
string $document = ""
29+
string $document,
30+
string $characterSet = "UTF-8",
31+
string $contentType = "text/html"
2832
) {
29-
parent::__construct($objectManager, $document);
30-
$this->document = $this->objectManager->create(GtDomHTMLDocument::class, [ 'document' => $document ]);
33+
parent::__construct($objectManager, $characterSet, $contentType);
34+
$this->document = $this->objectManager->create(
35+
GtDomHTMLDocument::class,
36+
[
37+
"html" => $document,
38+
"characterSet" => $characterSet
39+
]
40+
);
3141
}
3242

3343
/**

app/code/Magento/PageBuilder/Model/Dom/StringMap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
namespace Magento\PageBuilder\Model\Dom;
99

10-
use Gt\Dom\StringMap as GtDomStringMap;
10+
use Gt\Dom\DOMStringMap as GtDomStringMap;
1111
use Magento\Framework\ObjectManagerInterface;
1212
use Magento\PageBuilder\Model\Dom\Adapter\StringMapInterface;
1313

app/code/Magento/PageBuilder/Model/Dom/TokenList.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
namespace Magento\PageBuilder\Model\Dom;
99

10-
use Gt\Dom\TokenList as GtDomTokenList;
10+
use Gt\Dom\DOMTokenList as GtDomTokenList;
1111
use Magento\Framework\ObjectManagerInterface;
1212
use Magento\PageBuilder\Model\Dom\Adapter\TokenListInterface;
1313

app/code/Magento/PageBuilder/Model/Dom/XmlDocument.php

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,22 @@ class XmlDocument extends Document implements XmlDocumentInterface
2121
*
2222
* @param ObjectManagerInterface $objectManager
2323
* @param string $document
24+
* @param string $characterSet
25+
* @param string $contentType
2426
*/
2527
public function __construct(
2628
ObjectManagerInterface $objectManager,
27-
string $document = ""
29+
string $document = "",
30+
string $characterSet = "UTF-8",
31+
string $contentType = "text/html"
2832
) {
29-
parent::__construct($objectManager, $document);
30-
$this->document = $this->objectManager->create(GtDomXmlDocument::class, [ 'document' => $document ]);
33+
parent::__construct($objectManager, $characterSet, $contentType);
34+
$this->document = $this->objectManager->create(
35+
GtDomXmlDocument::class,
36+
[
37+
"document" => $document,
38+
"characterSet" => $characterSet
39+
]
40+
);
3141
}
3242
}

app/code/Magento/PageBuilder/Test/Mftf/ActionGroup/ContentTypeImageActionGroup/AddImageToStageActionGroup.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<argument name="property"/>
1313
</arguments>
1414
<comment userInput="Attach image A to PageBuilder stage" stepKey="commentAttach"/>
15-
<attachFile userInput="{{property.value}}" selector="{{ImageOnStageWithoutImageUploaded.attachImageBtn}}" stepKey="attachImageFileOnStage"/>
15+
<attachFile userInput="{{property.value}}" selector="{{ImageOnStageWithoutImageUploaded.attachImageBtnWithUploaderId}}" stepKey="attachImageFileOnStage"/>
1616
<waitForPageLoad stepKey="waitForPageLoad"/>
1717
<waitForElementVisible selector="{{ImageOnStageWithoutImageUploaded.imagePreview}}" stepKey="waitForImagePreview"/>
1818
<waitForElementVisible selector="{{ImageOnStageWithoutImageUploaded.imageSource(property.fileName)}}" stepKey="waitForImageSource"/>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="validateSlideOutPanelFieldHelperTextWithUploaderId">
11+
<annotations>
12+
<description>Validates the helper text for a field on the edit panel form.</description>
13+
</annotations>
14+
<arguments>
15+
<argument name="property"/>
16+
</arguments>
17+
<waitForElement time="2" selector="{{EditPanelForm.panelFieldHelperTextWithUploaderId(property.section, property.fieldName)}}" stepKey="waitForElement"/>
18+
<see userInput="{{property.helperText}}" selector="{{EditPanelForm.panelFieldHelperTextWithUploaderId(property.section, property.fieldName)}}" stepKey="seeHelperText"/>
19+
</actionGroup>
20+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="validateSlideOutPanelFieldTooltipWithUploaderId">
11+
<annotations>
12+
<description>Validates the tooltip for a field on the edit panel form.</description>
13+
</annotations>
14+
<arguments>
15+
<argument name="property"/>
16+
</arguments>
17+
<waitForElement time="2" selector="{{EditPanelForm.panelFieldTooltipWithUploaderId(property.section, property.fieldName)}}" stepKey="waitForTooltip"/>
18+
<moveMouseOver selector="{{EditPanelForm.panelFieldTooltipWithUploaderId(property.section, property.fieldName)}}" stepKey="mouseOverTooltip"/>
19+
<waitForElementVisible selector="{{EditPanelForm.panelFieldTooltipContentWithUploaderId(property.section, property.fieldName)}}" stepKey="waitForTooltipContentVisible"/>
20+
<see userInput="{{property.tooltipText}}" selector="{{EditPanelForm.panelFieldTooltipContentWithUploaderId(property.section, property.fieldName)}}" stepKey="seeTooltipContent"/>
21+
</actionGroup>
22+
</actionGroups>

0 commit comments

Comments
 (0)