File tree Expand file tree Collapse file tree 2 files changed +29
-1
lines changed
dev/tests/functional/tests/app/Magento
SalesRule/Test/Block/Adminhtml/Promo/Quote/Edit Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Original file line number Diff line number Diff line change 10
10
use Magento \Mtf \Client \Locator ;
11
11
12
12
/**
13
- * Class Search
14
13
* Block for "Search" section
15
14
*/
16
15
class Search extends Block
@@ -158,4 +157,24 @@ public function clickSuggestedText($text)
158
157
$ searchAutocomplete = sprintf ($ this ->searchAutocomplete , $ text );
159
158
$ this ->_rootElement ->find ($ searchAutocomplete , Locator::SELECTOR_XPATH )->click ();
160
159
}
160
+
161
+ /**
162
+ * Wait for element is enabled.
163
+ *
164
+ * @param string $selector
165
+ * @param string $strategy
166
+ * @return bool|null
167
+ */
168
+ public function waitForElementEnabled ($ selector , $ strategy = Locator::SELECTOR_CSS )
169
+ {
170
+ $ browser = $ this ->browser ;
171
+
172
+ return $ browser ->waitUntil (
173
+ function () use ($ browser , $ selector , $ strategy ) {
174
+ $ element = $ browser ->find ($ selector , $ strategy );
175
+
176
+ return !$ element ->isDisabled () ? true : null ;
177
+ }
178
+ );
179
+ }
161
180
}
Original file line number Diff line number Diff line change @@ -28,6 +28,13 @@ class PromoQuoteForm extends FormSections
28
28
*/
29
29
protected $ waitForSelectorVisible = false ;
30
30
31
+ /**
32
+ * Selector of name element on the form.
33
+ *
34
+ * @var string
35
+ */
36
+ private $ nameElementSelector = 'input[name=name] ' ;
37
+
31
38
/**
32
39
* Fill form with sections.
33
40
*
@@ -38,6 +45,8 @@ class PromoQuoteForm extends FormSections
38
45
*/
39
46
public function fill (FixtureInterface $ fixture , SimpleElement $ element = null , array $ replace = null )
40
47
{
48
+ $ this ->waitForElementNotVisible ($ this ->waitForSelector );
49
+ $ this ->waitForElementVisible ($ this ->nameElementSelector );
41
50
$ sections = $ this ->getFixtureFieldsByContainers ($ fixture );
42
51
if ($ replace ) {
43
52
$ sections = $ this ->prepareData ($ sections , $ replace );
You can’t perform that action at this time.
0 commit comments