File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed
dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,13 @@ class Grid extends DataGrid
76
76
*/
77
77
protected $ firstRowSelector = '//tbody/tr[1]/td[contains(@class,"data-grid-actions-cell")]/a ' ;
78
78
79
+ /**
80
+ * Global seach block selector.
81
+ *
82
+ * @var string
83
+ */
84
+ private $ globalSearch = '.search-global ' ;
85
+
79
86
/**
80
87
* Start to create new order.
81
88
*
@@ -106,4 +113,33 @@ public function getPurchasePointStoreGroups()
106
113
107
114
return $ result ;
108
115
}
116
+
117
+ /**
118
+ * {@inheritdoc}
119
+ */
120
+ public function selectItems (array $ items , $ isSortable = true )
121
+ {
122
+ if ($ isSortable ) {
123
+ $ this ->sortGridByField ('ID ' );
124
+ }
125
+ foreach ($ items as $ item ) {
126
+ //Hover on search block is made to avoid click on invisible element currentPage
127
+ $ searchBlock = $ this ->browser ->find ($ this ->globalSearch );
128
+ $ searchBlock ->hover ();
129
+ $ this ->_rootElement ->find ($ this ->currentPage , Locator::SELECTOR_XPATH )->setValue ('' );
130
+ $ this ->waitLoader ();
131
+ $ selectItem = $ this ->getRow ($ item )->find ($ this ->selectItem );
132
+ do {
133
+ if ($ selectItem ->isVisible ()) {
134
+ if (!$ selectItem ->isSelected ()) {
135
+ $ selectItem ->click ();
136
+ }
137
+ break ;
138
+ }
139
+ } while ($ this ->nextPage ());
140
+ if (!$ selectItem ->isVisible ()) {
141
+ throw new \Exception ("Searched item was not found \n" . print_r ($ item , true ));
142
+ }
143
+ }
144
+ }
109
145
}
You can’t perform that action at this time.
0 commit comments