public function VarbaseContext::iShouldSeeInThePanelRegion in Varbase: The Ultimate Drupal CMS Starter Kit (Bootstrap Ready) 9.0.x
Same name and namespace in other branches
- 8.8 tests/features/bootstrap/VarbaseContext.php \VarbaseContext::iShouldSeeInThePanelRegion()
- 8.4 tests/features/bootstrap/VarbaseContext.php \VarbaseContext::iShouldSeeInThePanelRegion()
- 8.5 tests/features/bootstrap/VarbaseContext.php \VarbaseContext::iShouldSeeInThePanelRegion()
- 8.6 tests/features/bootstrap/VarbaseContext.php \VarbaseContext::iShouldSeeInThePanelRegion()
- 8.7 tests/features/bootstrap/VarbaseContext.php \VarbaseContext::iShouldSeeInThePanelRegion()
Check if we do have the text in the selected panel region.
Using the code name of the panel region. or the html id. Varbase Context #varbase.
Example #1: Then I should see "Add new pane" in the "Center" panel region Example #2: Then I should see "custom pane title" in the "Right side" panel region Example #3: And I should see "Add new pane" in the "panels-ipe-regionid-center" panel region.
@Then /^I should see "(?P<text>[^"]*)" in the "(?P<panleRegion>[^"]*)" panel region$/
File
- tests/
features/ bootstrap/ VarbaseContext.php, line 1090
Class
- VarbaseContext
- Defines application features from the specific context.
Code
public function iShouldSeeInThePanelRegion($text, $panleRegion) {
if (strpos($panleRegion, "panels-ipe-regionid-")) {
$panleRegionId = $panleRegion;
}
else {
$panleRegionId = "panels-ipe-regionid-" . str_replace(' ', '-', strtolower($panleRegion));
}
$elementPanelRegion = $this
->getSession()
->getPage()
->find('xpath', "//*[contains(@id, '{$panleRegionId}')]");
if (empty($elementPanelRegion)) {
throw new \Exception('The panle region [ ' . $panleRegion . ' ] is not in the page.');
}
$element = $this
->getSession()
->getPage()
->find('xpath', "//*[contains(@id, '{$panleRegionId}')]//*[text()='{$text}']");
if (empty($element)) {
throw new \Exception('The panle region "' . $panleRegion . '" dose not have "' . $text . '" in it.');
}
}