File tree Expand file tree Collapse file tree 1 file changed +17
-5
lines changed
dev/tests/functional/tests/app/Magento/Backend/Test/Block/Dashboard/Tab/Products Expand file tree Collapse file tree 1 file changed +17
-5
lines changed Original file line number Diff line number Diff line change 15
15
*/
16
16
class Ordered extends Grid
17
17
{
18
+ /**
19
+ * Base part of row locator template
20
+ *
21
+ * @var string
22
+ */
23
+ protected $ location = '//table[@id="productsOrderedGrid_table"]/tbody/tr ' ;
24
+
25
+ /**
26
+ * Secondary part of row locator template
27
+ *
28
+ * @var string
29
+ */
30
+ protected $ rowTemplate = 'td[contains(., "%s")] ' ;
31
+
18
32
/**
19
33
* Check if ordered product is in grid
20
34
*
@@ -23,19 +37,17 @@ class Ordered extends Grid
23
37
*/
24
38
public function isProductVisible (CatalogProductSimple $ product )
25
39
{
26
- $ location = '//table[@id="productsOrderedGrid_table"]/tbody/tr[ ' ;
27
- $ rowTemplate = 'td[contains(., "%s")] ' ;
28
40
$ filter = [
29
41
$ product ->getName (),
30
42
$ product ->getPrice (),
31
43
$ product ->getCheckoutData ()['qty ' ],
32
44
];
33
45
$ rows = [];
34
46
foreach ($ filter as $ value ) {
35
- $ rows [] = sprintf ($ rowTemplate , $ value );
47
+ $ rows [] = sprintf ($ this -> rowTemplate , $ value );
36
48
}
37
- $ location = $ location . implode (' and ' , $ rows ) . '] ' ;
49
+ $ location = $ this -> location . ' [ ' . implode (' and ' , $ rows ) . '] ' ;
38
50
39
- return $ this ->_rootElement ->find ($ location , Locator::SELECTOR_XPATH )->isVisible () ? true : false ;
51
+ return $ this ->_rootElement ->find ($ location , Locator::SELECTOR_XPATH )->isVisible ();
40
52
}
41
53
}
You can’t perform that action at this time.
0 commit comments