From: Coleman Watts Date: Wed, 17 Sep 2014 04:08:51 +0000 (-0400) Subject: Add clickLinkSuppressPopup webtest method X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=405bc6ee71b3eca9625574ded005e4caf7a7d8d6;p=civicrm-core.git Add clickLinkSuppressPopup webtest method --- diff --git a/tests/phpunit/CiviTest/CiviSeleniumTestCase.php b/tests/phpunit/CiviTest/CiviSeleniumTestCase.php index e517f4bb60..e9fadeb82e 100644 --- a/tests/phpunit/CiviTest/CiviSeleniumTestCase.php +++ b/tests/phpunit/CiviTest/CiviSeleniumTestCase.php @@ -236,6 +236,20 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { } } + /** + * Click on a link and have it open full-page + * @param $element + * @param string $waitFor + */ + function clickLinkSuppressPopup($element, $waitFor = 'civicrm-footer') { + $link = $this->getAttribute($element . '@href'); + $this->open($link); + $this->waitForPageToLoad($this->getTimeoutMsec()); + if ($waitFor) { + $this->waitForElementPresent($waitFor); + } + } + /** * Call the API on the local server * (kind of defeats the point of a webtest - see CRM-11889) diff --git a/tests/phpunit/WebTest/Contact/SignatureTest.php b/tests/phpunit/WebTest/Contact/SignatureTest.php index a4ce36cae1..157c42483a 100644 --- a/tests/phpunit/WebTest/Contact/SignatureTest.php +++ b/tests/phpunit/WebTest/Contact/SignatureTest.php @@ -71,8 +71,8 @@ class WebTest_Contact_SignatureTest extends CiviSeleniumTestCase { // Go for Ckeck Your Editor, Click on Send Mail $this->click("//a[@id='crm-contact-actions-link']/span"); - //after clicking on 'Send an Email', wait for the text in tinymce editor to load - $this->clickLink('link=Send an Email', "xpath=//body[@id='tinymce']/p[2]", FALSE); + // the other test checks this in a popup, we'll try it full-page here + $this->clickLinkSuppressPopup('link=Send an Email', "xpath=//body[@id='tinymce']/p[2]"); $this->click('subject'); $subject = 'Subject_' . substr(sha1(rand()), 0, 8);