|
@@ 444-456 (lines=13) @@
|
| 441 |
|
* |
| 442 |
|
* @When /^(?:|I )follow "(?P<link>(?:[^"]|\\")*)" in preview$/ |
| 443 |
|
*/ |
| 444 |
|
public function clickLinkInPreview($link) |
| 445 |
|
{ |
| 446 |
|
$driver = $this->getSession()->getDriver(); |
| 447 |
|
// TODO Remove once we have native support in Mink and php-webdriver, |
| 448 |
|
// see https://groups.google.com/forum/#!topic/behat/QNhOuGHKEWI |
| 449 |
|
$origWindowName = $driver->getWebDriverSession()->window_handle(); |
| 450 |
|
$driver->switchToIFrame('cms-preview-iframe'); |
| 451 |
|
|
| 452 |
|
$link = $this->fixStepArgument($link); |
| 453 |
|
$this->getSession()->getPage()->clickLink($link); |
| 454 |
|
|
| 455 |
|
$driver->switchToWindow($origWindowName); |
| 456 |
|
} |
| 457 |
|
|
| 458 |
|
/** |
| 459 |
|
* When I press "submit" in preview |
|
@@ 463-475 (lines=13) @@
|
| 460 |
|
* |
| 461 |
|
* @When /^(?:|I )press "(?P<button>(?:[^"]|\\")*)" in preview$/ |
| 462 |
|
*/ |
| 463 |
|
public function pressButtonInPreview($button) |
| 464 |
|
{ |
| 465 |
|
$driver = $this->getSession()->getDriver(); |
| 466 |
|
// TODO Remove once we have native support in Mink and php-webdriver, |
| 467 |
|
// see https://groups.google.com/forum/#!topic/behat/QNhOuGHKEWI |
| 468 |
|
$origWindowName = $driver->getWebDriverSession()->window_handle(); |
| 469 |
|
$driver->switchToIFrame('cms-preview-iframe'); |
| 470 |
|
|
| 471 |
|
$button = $this->fixStepArgument($button); |
| 472 |
|
$this->getSession()->getPage()->pressButton($button); |
| 473 |
|
|
| 474 |
|
$driver->switchToWindow($origWindowName); |
| 475 |
|
} |
| 476 |
|
|
| 477 |
|
/** |
| 478 |
|
* Workaround for chosen.js dropdowns or tree dropdowns which hide the original dropdown field. |