@@ -60,17 +60,7 @@ class Form extends Block
6060 */
6161 public function getGroup ($ tabName , $ groupName )
6262 {
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 );
7464
7565 $ groupElement = $ this ->_rootElement ->find (
7666 sprintf ($ this ->groupBlock , $ tabName , $ groupName ),
@@ -95,6 +85,24 @@ public function getGroup($tabName, $groupName)
9585 return $ blockFactory ->getMagentoBackendSystemConfigFormGroup ($ groupElement );
9686 }
9787
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+
98106 /**
99107 * Retrieve url associated with the form.
100108 */
@@ -137,4 +145,24 @@ private function getTabUrl($tabName)
137145
138146 return $ tabUrl ;
139147 }
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+ }
140168}
0 commit comments