From: Ravish Nair Date: Thu, 28 Mar 2013 13:24:16 +0000 (+0530) Subject: -- webtest fixes and improvement X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=baaf85ee9f595916f173ebcfebb61617a511b6b0;p=civicrm-core.git -- webtest fixes and improvement --- diff --git a/tests/phpunit/WebTest/Campaign/SurveyUsageScenarioTest.php b/tests/phpunit/WebTest/Campaign/SurveyUsageScenarioTest.php index 8015d746b1..9c53597e2d 100644 --- a/tests/phpunit/WebTest/Campaign/SurveyUsageScenarioTest.php +++ b/tests/phpunit/WebTest/Campaign/SurveyUsageScenarioTest.php @@ -534,8 +534,8 @@ class WebTest_Campaign_SurveyUsageScenarioTest extends CiviSeleniumTestCase { $this->waitForElementPresent('_qf_Interview_cancel_interview'); $this->type("field_{$id1}_phone-Primary-1", 9876543210); - $this->click("//table[@id='voterRecords']/tbody//tr[@id='row_{$id1}']/td[5]/input[2]/../label[text()='$label1']"); - $this->click("//table[@id='voterRecords']/tbody//tr[@id='row_{$id1}']/td[5]/input[6]/../label[text()='$label2']"); + $this->click("//table[@id='voterRecords']/tbody//tr[@id='row_{$id1}']/td[7]/input[2]/../label[text()='$label1']"); + $this->click("//table[@id='voterRecords']/tbody//tr[@id='row_{$id1}']/td[7]/input[6]/../label[text()='$label2']"); $this->select("field_{$id1}_result", $optionLabel1); $this->click("interview_voter_button_{$id1}"); // Because it tends to cause problems, all uses of sleep() must be justified in comments diff --git a/tests/phpunit/WebTest/Case/ActivityToCaseTest.php b/tests/phpunit/WebTest/Case/ActivityToCaseTest.php index 6f069c3aaa..2425293b9d 100644 --- a/tests/phpunit/WebTest/Case/ActivityToCaseTest.php +++ b/tests/phpunit/WebTest/Case/ActivityToCaseTest.php @@ -206,7 +206,7 @@ class WebTest_Case_ActivityToCaseTest extends CiviSeleniumTestCase { $this->click("xpath=//div[@id='activities']//table[@id='activities-selector']/tbody//tr/td[2]/a[text()='{$subject}']/../../td[6]/a[text()='Scheduled']"); - $this->waitForElementPresent("css=div#changeStatusDialog"); + $this->waitForElementPresent("xpath=//html/body/div[7]"); $this->waitForElementPresent('activity_change_status'); // change activity status diff --git a/tests/phpunit/WebTest/Contact/MergeContactsTest.php b/tests/phpunit/WebTest/Contact/MergeContactsTest.php index 8826cecd2d..e82a386856 100644 --- a/tests/phpunit/WebTest/Contact/MergeContactsTest.php +++ b/tests/phpunit/WebTest/Contact/MergeContactsTest.php @@ -101,7 +101,7 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase { $this->click("_qf_Contact_refresh_dedupe"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertTrue($this->isTextPresent("One matching contact was found. You can View or Edit the existing contact.")); + $this->waitForText('crm-notification-container', "One matching contact was found. You can View or Edit the existing contact."); $this->click("_qf_Contact_upload_duplicate"); $this->waitForPageToLoad($this->getTimeoutMsec()); $this->waitForText('crm-notification-container', "Contact Saved"); @@ -119,7 +119,7 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase { $this->type("email_1_email", $email2); $this->click("_qf_Contact_refresh_dedupe"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertTrue($this->isTextPresent("One matching contact was found. You can View or Edit the existing contact.")); + $this->waitForText('crm-notification-container', "One matching contact was found. You can View or Edit the existing contact."); $this->click("_qf_Contact_upload_duplicate"); $this->waitForPageToLoad($this->getTimeoutMsec()); $this->waitForText('crm-notification-container', "Contact Saved"); @@ -263,7 +263,7 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); // Is status message correct? - $this->assertTrue($this->isTextPresent("Activity '$subject' has been saved."), "Status message didn't show up after saving!"); + $this->waitForText('crm-notification-container', "Activity '$subject' has been saved.", "Status message didn't show up after saving!"); } function testMergeTest() { @@ -322,7 +322,7 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase { $this->click("_qf_Contact_refresh_dedupe"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertTrue($this->isTextPresent("One matching contact was found. You can View or Edit the existing contact.")); + $this->waitForText('crm-notification-container', "One matching contact was found. You can View or Edit the existing contact."); $this->click("_qf_Contact_upload_duplicate"); $this->waitForPageToLoad($this->getTimeoutMsec()); $this->waitForText('crm-notification-container', "Contact Saved"); @@ -411,7 +411,7 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase { // Clicking save. $this->click("_qf_Contact_refresh_dedupe"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertTrue($this->isTextPresent("One matching contact was found. You can View or Edit the existing contact.")); + $this->waitForText('crm-notification-container', "One matching contact was found. You can View or Edit the existing contact."); $this->click("_qf_Contact_upload_duplicate"); $this->waitForPageToLoad($this->getTimeoutMsec()); $this->waitForText('crm-notification-container', "Contact Saved"); @@ -520,7 +520,7 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase { $this->click("_qf_Contact_refresh_dedupe"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertTrue($this->isTextPresent("One matching contact was found. You can View or Edit the existing contact.")); + $this->waitForText('crm-notification-container', "One matching contact was found. You can View or Edit the existing contact."); $this->click("_qf_Contact_upload_duplicate"); $this->waitForPageToLoad($this->getTimeoutMsec()); $this->waitForText('crm-notification-container', "Contact Saved"); @@ -629,7 +629,7 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase { $this->click("_qf_Contact_refresh_dedupe"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertTrue($this->isTextPresent("One matching contact was found. You can View or Edit the existing contact.")); + $this->waitForText('crm-notification-container', "One matching contact was found. You can View or Edit the existing contact."); $this->click("_qf_Contact_upload_duplicate"); $this->waitForPageToLoad($this->getTimeoutMsec()); $this->waitForText('crm-notification-container', "Contact Saved");