Skip to content

Commit caba2fd

Browse files
committed
Merge pull request #76 from puneet0191/TabVerification
Adding a Function to VerifyTabs
2 parents 0999fe6 + 6dc03b3 commit caba2fd

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/JoomlaBrowser.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -822,4 +822,22 @@ public function setFilter($label, $value)
822822
}
823823
$I->debug('Applied filters');
824824
}
825+
826+
/**
827+
* Function to Verify the Tabs on a Joomla! screen
828+
*
829+
* @param Array $expectedTabs Expected Tabs on the Page
830+
* @param String $tabSelector Selector for the Tabs in Edit View
831+
*
832+
* @return void
833+
*/
834+
public function verifyAvailableTabs($expectedTabs, $tabSelector = ['xpath' => "//ul[@id='myTabTabs']/li/a"])
835+
{
836+
$I = $this;
837+
$actualArrayOfTabs = $I->grabMultiple($tabSelector);
838+
$I->debug("Fetch the current list of Tabs in the edit view which is: " . implode(", ", $actualArrayOfTabs));
839+
$url = $I->grabFromCurrentUrl();
840+
$I->assertEquals($expectedTabs, $actualArrayOfTabs, "Tab Labels do not match on edit view of" . $url);
841+
$I->debug('Verify the Tabs');
842+
}
825843
}

0 commit comments

Comments
 (0)