You are here

public function VarbaseContext::iShouldNotSeeInThePanelRegion in Varbase: The Ultimate Drupal CMS Starter Kit (Bootstrap Ready) 9.0.x

Same name and namespace in other branches
  1. 8.8 tests/features/bootstrap/VarbaseContext.php \VarbaseContext::iShouldNotSeeInThePanelRegion()
  2. 8.4 tests/features/bootstrap/VarbaseContext.php \VarbaseContext::iShouldNotSeeInThePanelRegion()
  3. 8.5 tests/features/bootstrap/VarbaseContext.php \VarbaseContext::iShouldNotSeeInThePanelRegion()
  4. 8.6 tests/features/bootstrap/VarbaseContext.php \VarbaseContext::iShouldNotSeeInThePanelRegion()
  5. 8.7 tests/features/bootstrap/VarbaseContext.php \VarbaseContext::iShouldNotSeeInThePanelRegion()

Check if we do not 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 not see "Add new pane" in the "Center" panel region Example #2: Then I should not see "custom pane title" in the "Right side" panel region Example #3: And I should not see "Add new pane" in the "panels-ipe-regionid-center" panel region.

@Then /^I should not see "(?P<text>[^"]*)" in the "(?P<panleRegion>[^"]*)" panel region$/

File

tests/features/bootstrap/VarbaseContext.php, line 1122

Class

VarbaseContext
Defines application features from the specific context.

Code

public function iShouldNotSeeInThePanelRegion($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 have "' . $text . '" in it.');
  }
}