File tree Expand file tree Collapse file tree 2 files changed +46
-0
lines changed
dev/tests/functional/tests/app/Magento/Catalog/Test Expand file tree Collapse file tree 2 files changed +46
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Copyright © 2016 Magento. All rights reserved.
4
+ * See COPYING.txt for license details.
5
+ */
6
+
7
+ namespace Magento \Catalog \Test \Constraint ;
8
+
9
+ use Magento \Mtf \Fixture \InjectableFixture ;
10
+ use Magento \Mtf \Constraint \AbstractConstraint ;
11
+ use Magento \Catalog \Test \Page \Adminhtml \CatalogProductIndex ;
12
+
13
+ class AssertProductHasImageInGrid extends AbstractConstraint
14
+ {
15
+ /**
16
+ * Assert that product image is present in grid.
17
+ *
18
+ * @param CatalogProductIndex $productGrid
19
+ * @param InjectableFixture $product
20
+ * @return void
21
+ */
22
+ public function processAssert (
23
+ CatalogProductIndex $ productGrid ,
24
+ InjectableFixture $ product
25
+ ) {
26
+ $ filter = ['sku ' => $ product ->getSku ()];
27
+ $ productGrid ->open ();
28
+ $ productGrid ->getProductGrid ()->search ($ filter );
29
+ $ src = $ productGrid ->getProductGrid ()->getBaseImageSource ();
30
+ \PHPUnit_Framework_Assert::assertTrue (
31
+ strpos ($ src , '/placeholder/ ' ) === false ,
32
+ 'Product image is not present in product grid when it should be '
33
+ );
34
+ }
35
+
36
+ /**
37
+ * Returns a string representation of the object.
38
+ *
39
+ * @return string
40
+ */
41
+ public function toString ()
42
+ {
43
+ return 'Product image is displayed in product grid. ' ;
44
+ }
45
+ }
Original file line number Diff line number Diff line change 520
520
<data name =" tag" xsi : type =" string" >severity:S1</data >
521
521
<data name =" product/data/quantity_and_stock_status/qty" xsi : type =" string" >100</data >
522
522
<constraint name =" Magento\Catalog\Test\Constraint\AssertProductSaveMessage" />
523
+ <constraint name =" Magento\Catalog\Test\Constraint\AssertProductHasImageInGrid" />
523
524
<constraint name =" Magento\Catalog\Test\Constraint\AssertCanSaveProduct" />
524
525
</variation >
525
526
</testCase >
You can’t perform that action at this time.
0 commit comments