File tree Expand file tree Collapse file tree 2 files changed +16
-7
lines changed
dev/tests/functional/tests/app/Magento/Catalog/Test
Block/Adminhtml/Product/Edit/Section Expand file tree Collapse file tree 2 files changed +16
-7
lines changed Original file line number Diff line number Diff line change 11
11
use Magento \Ui \Test \Block \Adminhtml \Section ;
12
12
13
13
/**
14
- * Class for product gallery block
14
+ * Class for product gallery block.
15
15
*/
16
16
class BlockGallery extends Section
17
17
{
18
18
/**
19
+ * Selector for image loader container.
20
+ *
19
21
* @var string
20
22
*/
21
23
private $ imageLoader = '.image.image-placeholder .file-row ' ;
22
24
23
25
/**
24
- * Upload product images
26
+ * Selector for image upload input.
27
+ *
28
+ * @var string
29
+ */
30
+ private $ imageUploadInput = '[name="image"] ' ;
31
+
32
+ /**
33
+ * Upload product images.
25
34
*
26
35
* @param array $data
27
36
* @param SimpleElement|null $element
@@ -31,7 +40,7 @@ class BlockGallery extends Section
31
40
public function setFieldsData (array $ data , SimpleElement $ element = null )
32
41
{
33
42
foreach ($ data ['image ' ]['value ' ] as $ imageData ) {
34
- $ uploadElement = $ element ->find (' [name="image"] ' , Locator::SELECTOR_CSS , 'upload ' );
43
+ $ uploadElement = $ element ->find ($ this -> imageUploadInput , Locator::SELECTOR_CSS , 'upload ' );
35
44
$ uploadElement ->setValue ($ imageData ['file ' ]);
36
45
$ this ->waitForElementNotVisible ($ this ->imageLoader );
37
46
}
Original file line number Diff line number Diff line change 7
7
namespace Magento \Catalog \Test \Constraint ;
8
8
9
9
/**
10
- * Assert that can save already exist product
10
+ * Assert that can save already exist product.
11
11
*/
12
12
class AssertCanSaveProduct extends \Magento \Mtf \Constraint \AbstractConstraint
13
13
{
14
14
/**
15
- * Assert that can save already exist product
15
+ * Assert that can save already existing product.
16
16
*
17
17
* @param \Magento\Mtf\Fixture\FixtureInterface $product
18
18
* @param \Magento\Catalog\Test\Page\Adminhtml\CatalogProductEdit $catalogProductEdit
@@ -30,12 +30,12 @@ public function processAssert(
30
30
31
31
\PHPUnit_Framework_Assert::assertNotEmpty (
32
32
$ catalogProductEdit ->getMessagesBlock ()->getSuccessMessage (),
33
- 'Cant save existing product. '
33
+ 'Can \' t save existing product. '
34
34
);
35
35
}
36
36
37
37
/**
38
- * Returns a string representation of the object
38
+ * Returns a string representation of the object.
39
39
*
40
40
* @return string
41
41
*/
You can’t perform that action at this time.
0 commit comments