Source of file FeatureContext.php
Size: 0,734 Bytes - Last Modified: 2021-12-23T10:35:40+00:00
/var/www/docs.ssmods.com/process/src/tests/behat/src/FeatureContext.php
12345678910111213141516171819202122232425262728 | <?php namespace SilverStripe\UserForms\Tests\Behat\Context; use SilverStripe\BehatExtension\Context\SilverStripeContext; class FeatureContext extends SilverStripeContext { /** * The preview email button is a hyperlink with target="_blank" * Behat won't view the newly opened tab * * @When /^I preview the email$/ */ public function iPreviewTheEmail() { $js = <<<JS document.querySelectorAll('a.btn').forEach(link => { if (link.innerHTML.trim() == 'Preview email') { document.location.href = link.href; } }); JS; $result = $this->getSession()->getDriver()->executeScript($js); sleep(5); } } |