17
17
use Magento \Mtf \Client \Element \SimpleElement ;
18
18
19
19
/**
20
- * Is used to represent any form with tabs on the page
20
+ * Is used to represent any form with tabs on the page.
21
21
*
22
22
* @SuppressWarnings(PHPMD.NumberOfChildren)
23
23
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
24
24
*/
25
25
class FormTabs extends Form
26
26
{
27
27
/**
28
+ * Tabs list.
29
+ *
28
30
* @var array
29
31
*/
30
32
protected $ tabs = [];
31
33
32
34
/**
33
- * Fields which aren't assigned to any tab
35
+ * Fields which aren't assigned to any tab.
34
36
*
35
37
* @var array
36
38
*/
37
39
protected $ unassignedFields = [];
38
40
41
+ /**
42
+ * Page header selector.
43
+ *
44
+ * @var string
45
+ */
46
+ protected $ header = 'header ' ;
47
+
39
48
/**
40
49
* @constructor
41
50
* @param SimpleElement $element
@@ -55,15 +64,15 @@ public function __construct(
55
64
}
56
65
57
66
/**
58
- * Initialize block
67
+ * Initialize block.
59
68
*/
60
69
protected function init ()
61
70
{
62
71
$ this ->tabs = $ this ->getFormMapping ();
63
72
}
64
73
65
74
/**
66
- * Fill form with tabs
75
+ * Fill form with tabs.
67
76
*
68
77
* @param FixtureInterface $fixture
69
78
* @param SimpleElement|null $element
@@ -76,7 +85,7 @@ public function fill(FixtureInterface $fixture, SimpleElement $element = null)
76
85
}
77
86
78
87
/**
79
- * Fill specified form with tabs
88
+ * Fill specified form with tabs.
80
89
*
81
90
* @param array $tabs
82
91
* @param SimpleElement|null $element
@@ -91,14 +100,14 @@ protected function fillTabs(array $tabs, SimpleElement $element = null)
91
100
$ tab ->fillFormTab ($ tabFields , $ context );
92
101
}
93
102
if (!empty ($ this ->unassignedFields )) {
94
- $ this ->fillMissedFields ($ tabs );
103
+ $ this ->fillMissedFields ();
95
104
}
96
105
97
106
return $ this ;
98
107
}
99
108
100
109
/**
101
- * Fill fields which weren't found on filled tabs
110
+ * Fill fields which weren't found on filled tabs.
102
111
*
103
112
* @throws \Exception
104
113
* @SuppressWarnings(PHPMD.UnusedLocalVariable)
@@ -130,7 +139,7 @@ protected function fillMissedFields()
130
139
}
131
140
132
141
/**
133
- * Get data of the tabs
142
+ * Get data of the tabs.
134
143
*
135
144
* @param FixtureInterface|null $fixture
136
145
* @param SimpleElement|null $element
@@ -163,7 +172,7 @@ public function getData(FixtureInterface $fixture = null, SimpleElement $element
163
172
}
164
173
165
174
/**
166
- * Update form with tabs
175
+ * Update form with tabs.
167
176
*
168
177
* @param FixtureInterface $fixture
169
178
* @return FormTabs
@@ -178,7 +187,7 @@ public function update(FixtureInterface $fixture)
178
187
}
179
188
180
189
/**
181
- * Create data array for filling tabs
190
+ * Create data array for filling tabs.
182
191
*
183
192
* @param FixtureInterface $fixture
184
193
* @return array
@@ -194,7 +203,7 @@ protected function getFieldsByTabs(FixtureInterface $fixture)
194
203
}
195
204
196
205
/**
197
- * Create data array for filling tabs (new fixture specification)
206
+ * Create data array for filling tabs (new fixture specification).
198
207
*
199
208
* @param InjectableFixture $fixture
200
209
* @return array
@@ -217,7 +226,7 @@ private function getFixtureFieldsByTabs(InjectableFixture $fixture)
217
226
}
218
227
219
228
/**
220
- * Create data array for filling tabs (deprecated fixture specification)
229
+ * Create data array for filling tabs (deprecated fixture specification).
221
230
*
222
231
* @param FixtureInterface $fixture
223
232
* @return array
@@ -284,6 +293,7 @@ protected function getTabElement($tabName)
284
293
*/
285
294
public function openTab ($ tabName )
286
295
{
296
+ $ this ->browser ->find ($ this ->header )->hover ();
287
297
$ this ->getTabElement ($ tabName )->click ();
288
298
return $ this ;
289
299
}
0 commit comments