@@ -60,17 +60,7 @@ class Form extends Block
60
60
*/
61
61
public function getGroup ($ tabName , $ groupName )
62
62
{
63
- $ this ->baseUrl = $ this ->getBrowserUrl ();
64
- if (substr ($ this ->baseUrl , -1 ) !== '/ ' ) {
65
- $ this ->baseUrl = $ this ->baseUrl . '/ ' ;
66
- }
67
-
68
- $ tabUrl = $ this ->getTabUrl ($ tabName );
69
-
70
- if ($ this ->getBrowserUrl () !== $ tabUrl ) {
71
- $ this ->browser ->open ($ tabUrl );
72
- }
73
- $ this ->waitForElementNotVisible ($ this ->tabReadiness );
63
+ $ this ->openTab ($ tabName );
74
64
75
65
$ groupElement = $ this ->_rootElement ->find (
76
66
sprintf ($ this ->groupBlock , $ tabName , $ groupName ),
@@ -95,6 +85,24 @@ public function getGroup($tabName, $groupName)
95
85
return $ blockFactory ->getMagentoBackendSystemConfigFormGroup ($ groupElement );
96
86
}
97
87
88
+ /**
89
+ * Check whether specified group presented on page.
90
+ *
91
+ * @param string $tabName
92
+ * @param string $groupName
93
+ *
94
+ * @return bool
95
+ */
96
+ public function isGroupVisible (string $ tabName , string $ groupName )
97
+ {
98
+ $ this ->openTab ($ tabName );
99
+
100
+ return $ this ->_rootElement ->find (
101
+ sprintf ($ this ->groupBlockLink , $ tabName , $ groupName ),
102
+ Locator::SELECTOR_CSS
103
+ )->isVisible ();
104
+ }
105
+
98
106
/**
99
107
* Retrieve url associated with the form.
100
108
*/
@@ -137,4 +145,24 @@ private function getTabUrl($tabName)
137
145
138
146
return $ tabUrl ;
139
147
}
148
+
149
+ /**
150
+ * Open specified tab.
151
+ *
152
+ * @param string $tabName
153
+ * @return void
154
+ */
155
+ private function openTab (string $ tabName )
156
+ {
157
+ $ this ->baseUrl = $ this ->getBrowserUrl ();
158
+ if (substr ($ this ->baseUrl , -1 ) !== '/ ' ) {
159
+ $ this ->baseUrl = $ this ->baseUrl . '/ ' ;
160
+ }
161
+ $ tabUrl = $ this ->getTabUrl ($ tabName );
162
+
163
+ if ($ this ->getBrowserUrl () !== $ tabUrl ) {
164
+ $ this ->browser ->open ($ tabUrl );
165
+ }
166
+ $ this ->waitForElementNotVisible ($ this ->tabReadiness );
167
+ }
140
168
}
0 commit comments