WebTest Fixes 4.5
authorJitendra Purohit <jitendra.purohit@webaccessglobal.com>
Mon, 1 Sep 2014 13:43:04 +0000 (19:13 +0530)
committerJitendra Purohit <jitendra.purohit@webaccessglobal.com>
Mon, 1 Sep 2014 13:43:04 +0000 (19:13 +0530)
tests/phpunit/WebTest/Campaign/OfflineContributionTest.php
tests/phpunit/WebTest/Campaign/OfflineEventRegistrationTest.php
tests/phpunit/WebTest/Campaign/OnlineContributionTest.php
tests/phpunit/WebTest/Campaign/PledgeTest.php
tests/phpunit/WebTest/Contact/GroupAddTest.php
tests/phpunit/WebTest/Event/TellAFriendTest.php
tests/phpunit/WebTest/Export/ContactTest.php
tests/phpunit/WebTest/Import/SavedMappingTest.php

index 3851cb4121fb7b957913e65cb57b947dafccea3e..e60da9dae407ab75dbbb48050bf7d6f2c16368ed 100644 (file)
@@ -96,9 +96,7 @@ class WebTest_Campaign_OfflineContributionTest extends CiviSeleniumTestCase {
     $this->type("description", "This is a test campaign");
 
     // include groups for the campaign
-    $this->addSelection("includeGroups-f", "label=$groupName");
-    $this->click("//option[@value=4]");
-    $this->click("add");
+    $this->multiselect2("includeGroups", array("$groupName", "Advisory Board"));
 
     // fill the end date for campaign
     $this->webtestFillDate("end_date", "+1 year");
@@ -112,8 +110,8 @@ class WebTest_Campaign_OfflineContributionTest extends CiviSeleniumTestCase {
 
     $this->waitForText('crm-notification-container', "Campaign $title");
 
-    $this->waitForElementPresent("xpath=//div[@id='campaignList']/div[@id='campaigns_wrapper']/table[@id='campaigns']/tbody//tr/td[text()='$campaignTitle']");
-    $url = explode('id=', $this->getAttribute("xpath=//div[@id='campaignList']/div[@id='campaigns_wrapper']/table[@id='campaigns']/tbody//tr/td[text()='$campaignTitle']/../td[13]/span/a[text()='Edit']@href"));
+    $this->waitForElementPresent("xpath=//div[@id='campaignList']/div[@class='dataTables_wrapper no-footer']/table/tbody//tr/td[text()='$campaignTitle']");
+    $url = explode('id=', $this->getAttribute("xpath=//div[@id='campaignList']/div[@class='dataTables_wrapper no-footer']/table/tbody//tr/td[text()='$campaignTitle']/../td[13]/span/a[text()='Edit']@href"));
     $campaignId = $url[1];
 
     $this->offlineContributionTest($campaignTitle, $campaignId);
@@ -254,9 +252,7 @@ class WebTest_Campaign_OfflineContributionTest extends CiviSeleniumTestCase {
     $this->type("description", "This is a test for past campaign");
 
     // include groups for the campaign
-    $this->addSelection("includeGroups-f", "label=$groupName");
-    $this->click("//option[@value=4]");
-    $this->click("add");
+    $this->multiselect2("includeGroups", array("$groupName", "Advisory Board"));
 
     // fill the start date for campaign
     $this->webtestFillDate("start_date", "1 January 2011");
@@ -278,8 +274,8 @@ class WebTest_Campaign_OfflineContributionTest extends CiviSeleniumTestCase {
     $this->type("campaign_title", $pastCampaignTitle);
     $this->click("xpath=//div[@class='crm-accordion-body']/table/tbody/tr[4]/td/a[text()='Search']");
 
-    $this->waitForElementPresent("xpath=//div[@id='campaignList']/div[@id='campaigns_wrapper']/table[@id='campaigns']/tbody//tr/td[text()='$pastCampaignTitle']");
-    $url = explode('id=', $this->getAttribute("xpath=//div[@id='campaignList']/div[@id='campaigns_wrapper']/table[@id='campaigns']/tbody//tr/td[text()='$pastCampaignTitle']/../td[13]/span/a[text()='Edit']@href"));
+    $this->waitForElementPresent("xpath=//div[@id='campaignList']/div[@class='dataTables_wrapper no-footer']/table/tbody//tr/td[text()='$pastCampaignTitle']");
+    $url = explode('id=', $this->getAttribute("xpath=//div[@id='campaignList']/div[@class='dataTables_wrapper no-footer']/table/tbody//tr/td[text()='$pastCampaignTitle']/../td[13]/span/a[text()='Edit']@href"));
     $campaignId = $url[1];
 
     $this->offlineContributionTest($pastCampaignTitle, $campaignId, TRUE);
index 0500b902014724666c727f004fd43bcccf2738ed..59f256b45f306919afd1086dfa908b32e1c56502 100644 (file)
@@ -97,9 +97,7 @@ class WebTest_Campaign_OfflineEventRegistrationTest extends CiviSeleniumTestCase
     $this->type("description", "This is a test campaign");
 
     // include groups for the campaign
-    $this->addSelection("includeGroups-f", "label=$groupName");
-    $this->click("//option[@value=4]");
-    $this->click("add");
+    $this->multiselect2("includeGroups", array("$groupName", "Advisory Board"));
 
     // fill the end date for campaign
     $this->webtestFillDate("end_date", "+1 year");
@@ -115,8 +113,8 @@ class WebTest_Campaign_OfflineEventRegistrationTest extends CiviSeleniumTestCase
       "Status message didn't show up after saving campaign!"
     );
 
-    $this->waitForElementPresent("//div[@id='campaignList']/div[@id='campaigns_wrapper']/table/tbody/tr/td[text()='{$campaignTitle}']/../td[1]");
-    $id = (int) $this->getText("//div[@id='campaignList']/div[@id='campaigns_wrapper']/table/tbody/tr/td[text()='{$campaignTitle}']/../td[1]");
+    $this->waitForElementPresent("//div[@id='campaignList']/div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[text()='{$campaignTitle}']/../td[1]");
+    $id = (int) $this->getText("//div[@id='campaignList']/div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[text()='{$campaignTitle}']/../td[1]");
 
     $this->offlineParticipantAddTest($campaignTitle, $id);
   }
index af882642a3ce7534e8047405fc0dfb6195e44b87..66cbc2456c17ae6dbb269ec64ae59da1c007a593 100644 (file)
@@ -95,9 +95,7 @@ class WebTest_Campaign_OnlineContributionTest extends CiviSeleniumTestCase {
     $this->type("description", "This is a test campaign");
 
     // include groups for the campaign
-    $this->addSelection("includeGroups-f", "label=$groupName");
-    $this->click("//option[@value=4]");
-    $this->click("add");
+    $this->multiselect2("includeGroups", array("$groupName", "Advisory Board"));
 
     // fill the end date for campaign
     $this->webtestFillDate("end_date", "+1 year");
@@ -111,8 +109,8 @@ class WebTest_Campaign_OnlineContributionTest extends CiviSeleniumTestCase {
 
     $this->waitForText('crm-notification-container', "Campaign $title");
 
-    $this->waitForElementPresent("//div[@id='campaignList']/div[@id='campaigns_wrapper']/table/tbody/tr/td[text()='{$campaignTitle}']/../td[1]");
-    $id = (int) $this->getText("//div[@id='campaignList']/div[@id='campaigns_wrapper']/table/tbody/tr/td[text()='{$campaignTitle}']/../td[1]");
+    $this->waitForElementPresent("//div[@id='campaignList']/div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[text()='{$campaignTitle}']/../td[1]");
+    $id = (int) $this->getText("//div[@id='campaignList']/div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[text()='{$campaignTitle}']/../td[1]");
 
     $this->onlineContributionAddTest($campaignTitle, $id);
   }
index 7be7258b86243f885cd5ea76dca0ebedf68ad065..a582a1fc8c49b91532a05db7648ee1bdd885f65e 100644 (file)
@@ -96,9 +96,7 @@ class WebTest_Campaign_PledgeTest extends CiviSeleniumTestCase {
     $this->type("description", "This is a test campaign");
 
     // include groups for the campaign
-    $this->addSelection("includeGroups-f", "label=$groupName");
-    $this->click("//option[@value=4]");
-    $this->click("add");
+    $this->multiselect2("includeGroups", array("$groupName", "Advisory Board"));
 
     // fill the end date for campaign
     $this->webtestFillDate("end_date", "+1 year");
@@ -114,8 +112,8 @@ class WebTest_Campaign_PledgeTest extends CiviSeleniumTestCase {
       "Status message didn't show up after saving campaign!"
     );
 
-    $this->waitForElementPresent("//div[@id='campaignList']/div[@id='campaigns_wrapper']/table/tbody/tr/td[text()='{$campaignTitle}']/../td[1]");
-    $id = (int) $this->getText("//div[@id='campaignList']/div[@id='campaigns_wrapper']/table/tbody/tr/td[text()='{$campaignTitle}']/../td[1]");
+    $this->waitForElementPresent("//div[@id='campaignList']/div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[text()='{$campaignTitle}']/../td[1]");
+    $id = (int) $this->getText("//div[@id='campaignList']/div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[text()='{$campaignTitle}']/../td[1]");
     $this->pledgeAddTest($campaignTitle, $id);
   }
 
index 4e16677649f06116021920c80a192f789f96e3f3..8122518bd3b25078e36d83e524284f3a7dea2747 100644 (file)
@@ -74,9 +74,9 @@ class WebTest_Contact_GroupAddTest extends CiviSeleniumTestCase {
     $this->openCiviPage('group', 'reset=1');
     $this->type('title', $params['name']);
     $this->click('_qf_Search_refresh');
-    $this->waitForElementPresent("xpath=//table[@id='crm-group-selector']/tbody/tr/td[contains(., '{$params['name']}')]");
-    $createdBy = $this->getText("xpath=//table[@id='crm-group-selector']/tbody/tr/td[3]/a");
-    $this->click("xpath=//table[@id='crm-group-selector']/tbody/tr/td[7]/span/a[2]");
+    $this->waitForElementPresent("xpath=//table[@class='crm-group-selector no-footer dataTable']/tbody/tr/td/span[contains(text(), '{$params['name']}')]");
+    $createdBy = $this->getText("xpath=//table[@class='crm-group-selector no-footer dataTable']/tbody/tr/td[3]/a");
+    $this->click("xpath=//table[@class='crm-group-selector no-footer dataTable']/tbody/tr/td[7]/span/a[2]");
     $this->waitForElementPresent("xpath=//form[@id='Edit']/div[2]/div/table[2]/tbody/tr/td[2]/select");
 
     //assert created by in the edit page
@@ -91,15 +91,16 @@ class WebTest_Contact_GroupAddTest extends CiviSeleniumTestCase {
     //show maximum no. of groups on first result set page
     //as many groups can be created by same creator
     //and checking is done on first result set page
-    $this->waitForVisible('crm-group-selector_processing');
-    $this->select("xpath=//select[@name='crm-group-selector_length']", '100');
-    $this->waitForVisible('crm-group-selector_processing');
+    $this->waitForVisible("xpath=//table[@class='crm-group-selector no-footer dataTable']");
+    $this->select("xpath=//div[@class='dataTables_length']/label/select", '100');
+    $this->waitForVisible("xpath=//table[@class='crm-group-selector no-footer dataTable']");
 
-    $this->waitForElementPresent("xpath=//table[@id='crm-group-selector']/tbody/tr/td[contains(., '{$params['name']}')]");
-    $this->assertTrue($this->isElementPresent("xpath=//table[@id='crm-group-selector']/tbody/tr/td[contains(., '{$params['name']}')]/following-sibling::td[2]/a[text()='{$createdBy}']"));
+    $this->waitForElementPresent("xpath=//table[@class='crm-group-selector no-footer dataTable']/tbody/tr/td/span[contains(text(), '{$params['name']}')]");
+    $this->click("xpath=//table[@class='crm-group-selector no-footer dataTable']/tbody/tr/td/span[contains(text(), '{$params['name']}')]/../following-sibling::td[2]/a[text()='{$createdBy}']");
+    $this->assertTrue($this->isElementPresent("xpath=//table[@class='crm-group-selector no-footer dataTable']/tbody/tr/td/span[contains(text(), '{$params['name']}')]/../following-sibling::td[2]/a[text()='{$createdBy}']"));
 
     //check link of the contact who created the group
-    $this->click("xpath=//table[@id='crm-group-selector']/tbody//tr/td[1][contains(.,'{$params['name']}')]/following-sibling::td[2]/a");
+    $this->click("xpath=//table[@class='crm-group-selector no-footer dataTable']/tbody//tr/td[1]/span[contains(text(),'{$params['name']}')]/../following-sibling::td[2]/a");
     $this->waitForPageToLoad($this->getTimeoutMsec());
     $name = explode(',', $createdBy);
     $name1 = isset($name[1]) ? trim($name[1]) : NULL;
index 92bac878545a7e59df7fe4eb61cdc69c87a88fc6..7ac922af6285321ca0c248b2ff616c6a71faadda 100644 (file)
@@ -211,6 +211,7 @@ class WebTest_Event_TellAFriendTest extends CiviSeleniumTestCase {
     $this->type("address_1_street_address", $streetAddress);
     $this->type("address_1_city", "San Francisco");
     $this->type("address_1_postal_code", "94117");
+    $this->select('address_1_country_id', 'United States');
     $this->select("address_1_state_province_id", "value=1004");
     $this->type("email_1_email", "info@civicrm.org");
 
index 98183522d7d47b6cf87026ff5d6bab7494a6d938..5da4c611f3bd9980a9588fc5021d1692d7e48164 100644 (file)
@@ -101,7 +101,6 @@ class WebTest_Export_ContactTest extends ExportCiviSeleniumTestCase {
     // Select the task action to export.
     $this->click("task");
     $this->select("task", "label=Export Contacts");
-    $this->click("Go");
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
     $csvFile = $this->downloadCSV("_qf_Select_next-bottom");
@@ -222,7 +221,6 @@ class WebTest_Export_ContactTest extends ExportCiviSeleniumTestCase {
     // Select the task action to export.
     $this->click("task");
     $this->select("task", "label=Export Contacts");
-    $this->click("Go");
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
     $csvFile = $this->downloadCSV("_qf_Select_next-bottom");
@@ -376,7 +374,6 @@ class WebTest_Export_ContactTest extends ExportCiviSeleniumTestCase {
     // Select the task action to export.
     $this->click("task");
     $this->select("task", "label=Export Contacts");
-    $this->click("Go");
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
     $this->click("CIVICRM_QFID_2_10");
index 41c226f7d2d895634d7758955bd82043434d97b7..314f96825d6b02bfee21c99c4578ef7e2ff93dcb 100644 (file)
@@ -56,8 +56,8 @@ class WebTest_Import_SavedMappingTest extends ImportCiviSeleniumTestCase {
 
     // Map Fields
     $fieldMapper = array(
-      'mapper[0][0]' => 'individual_prefix',
-      'mapper[4][0]' => 'individual_suffix',
+      'mapper[0][0]' => 'prefix_id',
+      'mapper[4][0]' => 'suffix_id',
       'mapper[6][0]' => 'phone',
       'mapper[6][1]' => '5',
       'mapper[7][0]' => 'supplemental_address_1',