@@ 696-708 (lines=13) @@ | ||
693 | * |
|
694 | * @Given /^I (?:follow|click) "(?P<link>[^"]*)" in the "(?P<region>[^"]*)" region$/ |
|
695 | */ |
|
696 | public function iFollowInTheRegion($link, $region) |
|
697 | { |
|
698 | $context = $this->getMainContext(); |
|
699 | $regionObj = $context->getRegionObj($region); |
|
700 | assertNotNull($regionObj); |
|
701 | ||
702 | $linkObj = $regionObj->findLink($link); |
|
703 | if (empty($linkObj)) { |
|
704 | throw new \Exception(sprintf('The link "%s" was not found in the region "%s" |
|
705 | on the page %s', $link, $region, $this->getSession()->getCurrentUrl())); |
|
706 | } |
|
707 | ||
708 | $linkObj->click(); |
|
709 | } |
|
710 | ||
711 | /** |
|
@@ 718-730 (lines=13) @@ | ||
715 | * |
|
716 | * @Given /^I fill in "(?P<field>[^"]*)" with "(?P<value>[^"]*)" in the "(?P<region>[^"]*)" region$/ |
|
717 | */ |
|
718 | public function iFillinTheRegion($field, $value, $region) |
|
719 | { |
|
720 | $context = $this->getMainContext(); |
|
721 | $regionObj = $context->getRegionObj($region); |
|
722 | assertNotNull($regionObj, "Region Object is null"); |
|
723 | ||
724 | $fieldObj = $regionObj->findField($field); |
|
725 | if (empty($fieldObj)) { |
|
726 | throw new \Exception(sprintf('The field "%s" was not found in the region "%s" |
|
727 | on the page %s', $field, $region, $this->getSession()->getCurrentUrl())); |
|
728 | } |
|
729 | ||
730 | $regionObj->fillField($field, $value); |
|
731 | } |
|
732 | ||
733 |