From 2053a3e9ed540a821b7bc8769943ff98659a8127 Mon Sep 17 00:00:00 2001 From: Ravish Nair Date: Fri, 5 Apr 2013 19:49:27 +0530 Subject: [PATCH] -- webtest fixes(tests that is not listed in biryani and were failing) --- tests/phpunit/WebTest/Contact/ContactTagTest.php | 8 ++++---- .../WebTest/Contact/TaskActionSendMassMailing.php | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/phpunit/WebTest/Contact/ContactTagTest.php b/tests/phpunit/WebTest/Contact/ContactTagTest.php index 0da7371294..f4ba868490 100644 --- a/tests/phpunit/WebTest/Contact/ContactTagTest.php +++ b/tests/phpunit/WebTest/Contact/ContactTagTest.php @@ -56,7 +56,7 @@ class WebTest_Contact_ContactTagTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); // Is status message correct? - $this->assertTrue($this->isTextPresent("The tag '$tagName' has been saved.")); + $this->waitForText('crm-notification-container', "The tag '$tagName' has been saved."); // Adding contact // We're using Quick Add block on the main page for this. @@ -72,7 +72,7 @@ class WebTest_Contact_ContactTagTest extends CiviSeleniumTestCase { $this->waitForElementPresent("css=.success"); // Is status message correct? - $this->assertTrue($this->isTextPresent("Saved")); + $this->waitForText('crm-notification-container', "Saved"); } function testTagSetContact() { @@ -100,7 +100,7 @@ class WebTest_Contact_ContactTagTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); // Is status message correct? - $this->assertTrue($this->isTextPresent("The tag '$tagSetName' has been saved.")); + $this->waitForText('crm-notification-container', "The tag '$tagSetName' has been saved."); // Adding contact // We're using Quick Add block on the main page for this. @@ -148,7 +148,7 @@ class WebTest_Contact_ContactTagTest extends CiviSeleniumTestCase { // Visit contact summary page. $this->click("css=div.ac_results-inner li"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertTrue($this->isTextPresent("tagset1, tagset2")); + $this->waitForText('tags', "tagset1, tagset2"); } } diff --git a/tests/phpunit/WebTest/Contact/TaskActionSendMassMailing.php b/tests/phpunit/WebTest/Contact/TaskActionSendMassMailing.php index 4baf6715fd..2b39c09eab 100644 --- a/tests/phpunit/WebTest/Contact/TaskActionSendMassMailing.php +++ b/tests/phpunit/WebTest/Contact/TaskActionSendMassMailing.php @@ -47,9 +47,9 @@ class WebTest_Contact_TaskActionSendMassMailing extends CiviSeleniumTestCase { // Click "check all" box and act on "Add to group" action $this->click("//form[@id='Advanced']/div[3]/div/div[2]/table/thead/tr/th[1]/input"); + $this->waitForText('search-status', "50 Selected records only"); $this->select("task", "label=Schedule/Send a Mass Mailing"); - $this->click("Go"); - $this->waitForPageToLoad($this->getTimeoutMsec()); + $this->clickLink("Go"); //-------select recipients---------- @@ -77,7 +77,7 @@ class WebTest_Contact_TaskActionSendMassMailing extends CiviSeleniumTestCase { $this->type("subject", "Test subject {$mailingName} for Webtest"); // check for default option enabled - $this->assertChecked("CIVICRM_QFID_1_4"); + $this->assertChecked("CIVICRM_QFID_1_upload_type"); // HTML format message $HTMLMessage = "This is HTML formatted content for Mailing {$mailingName} Webtest."; @@ -107,8 +107,8 @@ class WebTest_Contact_TaskActionSendMassMailing extends CiviSeleniumTestCase { //----------end New Mailing------------- //check redirected page to Scheduled and Sent Mailings and verify for mailing name - $this->assertTrue($this->isTextPresent("Scheduled and Sent Mailings")); - $this->assertTrue($this->isTextPresent("$mailingName")); + $this->waitForText('page-title', "Scheduled and Sent Mailings"); + $this->waitForText('css=.selector', "$mailingName"); //--------- mail delivery verification--------- @@ -119,7 +119,7 @@ class WebTest_Contact_TaskActionSendMassMailing extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); // verify undelivered status message - $this->assertTrue($this->isTextPresent("Delivery has not yet begun for this mailing. If the scheduled delivery date and time is past, ask the system administrator or technical support contact for your site to verify that the automated mailer task ('cron job') is running - and how frequently.")); + $this->waitForText("css=.messages", "Delivery has not yet begun for this mailing. If the scheduled delivery date and time is past, ask the system administrator or technical support contact for your site to verify that the automated mailer task \('cron job'\) is running - and how frequently."); // directly send schedule mailing -- not working right now $this->openCiviPage("mailing/queue", "reset=1"); -- 2.25.1