Web Test Fix For 4.5 alpha1
authorjitendrapurohit <jitendra.purohit@webaccess.co.in>
Fri, 9 May 2014 12:10:07 +0000 (17:40 +0530)
committerjitendrapurohit <jitendra.purohit@webaccess.co.in>
Fri, 9 May 2014 12:10:07 +0000 (17:40 +0530)
tests/phpunit/WebTest/Event/AddPricesetTest.php
tests/phpunit/WebTest/Pledge/StandaloneAddDeleteTest.php
tests/phpunit/WebTest/Pledge/StandaloneAddTest.php
tests/phpunit/WebTest/Profile/ProfileAddTest.php

index f42111c53c8e739c9fb92afc1a6a89d3a62bbedc..3d433f436fe240adfda4189ca91eaf620e2bcecd 100644 (file)
@@ -445,9 +445,9 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase {
     $this->webtestFillAutocomplete($firstName);
 
     // Select event. Based on label for now.
-    $this->select2('s2id_event_id', "$eventTitle");
+    $this->select2('event_id', "$eventTitle");
     // Select role
-    $this->click('role_id[2]');
+    $this->multiselect2('role_id', array('Volunteer'));
 
     $this->click("xpath=//input[@class='crm-form-radio']");
     $this->click("xpath=//input[@class='crm-form-checkbox']");
@@ -464,7 +464,7 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase {
     $this->click('_qf_Participant_upload-bottom');
     $this->waitForPageToLoad($this->getTimeoutMsec());
     // Is status message correct?
-    $this->assertElementContainsText("css=#crm-notification-container", "Event registration for $displayName has been added", "Status message didn't show up after saving!");
+    $this->waitForText("crm-notification-container", "Event registration for $displayName has been added", "Status message didn't show up after saving!");
 
     $this->waitForElementPresent("xpath=//*[@id='Search']//table//tbody/tr[1]/td[8]/span/a[text()='View']");
 
@@ -560,7 +560,7 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase {
     $this->webtestFillAutocomplete($firstName);
     $this->select2('event_id', $eventTitle);
     // Select role
-    $this->click('role_id[2]');
+    $this->multiselect2('role_id', array('Volunteer'));
 
     // Choose Registration Date.
     // Using helper webtestFillDate function.
@@ -605,9 +605,10 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase {
         'Participant Role' => 'Attendee',
         'Status' => 'Registered',
         'Event Source' => 'Event StandaloneAddTest Webtest',
-        'Fees' => 'Total Fee(s) Total Paid Balance $ 2,705.00',
       )
     );
+    $this->waitForElementPresent("xpath=//table/tbody/tr/td[text()='Fees']/following-sibling::td");
+    $this->verifyText("xpath=//table/tbody/tr/td[text()='Fees']/following-sibling::td/table/tbody/tr[2]/td", preg_quote('$ 2,705.00'), 'In line ' . __LINE__);
     $expectedLineItems = array(
       2 => array(
         1 => 'Full Conference',
index 24ba28136b8045f5dbaf19feda5e6e89735fbe45..1d29b36e528f5472c2387656b64c2d7ae1f902cc 100644 (file)
@@ -70,7 +70,8 @@ class WebTest_Pledge_StandaloneAddDeleteTest extends CiviSeleniumTestCase {
         'Pledge Status' => 'Pending',
       )
     );
-    $this->clickLink('_qf_PledgeView_next-bottom', "xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']", FALSE);
+    $this->click('_qf_PledgeView_next-bottom');
+    $this->waitForElementPresent("xpath=//div[@class='view-content']//table[@class='selector row-highlight']//tbody/tr[1]/td[1]/span/a");
     $this->click("xpath=//div[@class='view-content']//table[@class='selector row-highlight']//tbody/tr[1]/td[1]/span/a");
     $this->waitForElementPresent("xpath=//div[@class='view-content']//table//tbody/tr[2]/td[2]/table/tbody/tr[2]/td[8]/a[text()='Record Payment (Check, Cash, EFT ...)']");
     $this->click("xpath=//div[@class='view-content']//table//tbody/tr[2]/td[2]/table/tbody/tr[2]/td[8]/a");
@@ -106,16 +107,16 @@ class WebTest_Pledge_StandaloneAddDeleteTest extends CiviSeleniumTestCase {
     $this->waitForText('crm-notification-container', "The contribution record has been saved.");
 
     // delete the contribution associated with the 2nd payment
-    $this->waitForElementPresent("xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
+    $this->waitForElementPresent("xpath=//div[@class='view-content']//table[@class='selector row-highlight']//tbody/tr[1]/td[10]/span/a[text()='View']");
     $this->click("xpath=//div[@class='view-content']//table[@class='selector row-highlight']//tbody/tr[1]/td[1]/span/a");
-    $this->waitForElementPresent("xpath=//div[@class='view-content']//table/tbody/tr[2]/td[2]/table/tbody/tr[3]/td[8]/a[text()='View Payment']");
-    $this->click("xpath=//div[@class='view-content']//table/tbody/tr[2]/td[2]/table/tbody/tr[3]/td[8]/a");
-    $this->waitForElementPresent("xpath=//form[@id='ContributionView']//div[2]/div/div/a[2]");
-    $this->click("xpath=//form[@id='ContributionView']//div[2]/div/div/a[2]");
-    $this->waitForElementPresent("_qf_Contribution_next-bottom");
-    $this->click("_qf_Contribution_next-bottom");
-    $this->waitForElementPresent("ui-id-4");
-    $this->click("ui-id-4");
+    $this->waitForElementPresent("xpath=//div[@class='view-content']//table[@class='selector row-highlight']/tbody/tr[2]/td[2]/table[@class='nestedSelector']/tbody/tr[3]/td[8]/a[text()='View Payment']");
+    $this->click("xpath=//div[@class='view-content']//table[@class='selector row-highlight']/tbody/tr[2]/td[2]/table[@class='nestedSelector']/tbody/tr[3]/td[8]/a");
+    $this->waitForElementPresent("xpath=//form[@id='ContributionView']//div[2]/div/div/a[2]/span[text()='Delete']");
+    $this->click("xpath=//form[@id='ContributionView']//div[2]/div/div/a[2]/span[text()='Delete']");
+    $this->waitForElementPresent("xpath=//form[@id='Contribution']/div[2]/div[2]/span/input[@value='Delete']");
+    $this->click("xpath=//form[@id='Contribution']/div[2]/div[2]/span/input[@value='Delete']");
+    $this->waitForElementPresent("ui-id-24");
+    $this->click("ui-id-24");
     $this->waitForElementPresent("xpath=//div[@class='view-content']//table[@class='selector row-highlight']//tbody/tr[1]/td[10]/span/a[text()='View']");
     $this->click("xpath=//div[@class='view-content']//table[@class='selector row-highlight']//tbody/tr[1]/td[1]/span/a");
     $this->waitForElementPresent("xpath=//div[@class='view-content']//table/tbody/tr[2]/td[2]/table/tbody/tr[3]/td[7]");
@@ -126,8 +127,8 @@ class WebTest_Pledge_StandaloneAddDeleteTest extends CiviSeleniumTestCase {
     // verify that payment owed amount is correct (250.00)
     $this->verifyText("xpath=//div[@class='view-content']//table/tbody/tr[2]/td[2]/table/tbody/tr[3]/td","250.00");
     // verify that Total Paid and Balance sums are correct
-    $this->verifyText("xpath=//div[@class='view-content']//table//tbody/tr[1]/td[3]","470.00");
-    $this->verifyText("xpath=//div[@class='view-content']//table//tbody/tr[1]/td[4]","1,930.00");
+    $this->verifyText("xpath=//div[@class='view-content' and contains(., 'view pledge payments')]/table[@class='selector row-highlight']//tbody/tr[1]/td[3]","470.00");
+    $this->verifyText("xpath=//div[@class='view-content' and contains(., 'view pledge payments')]/table[@class='selector row-highlight']//tbody/tr[1]/td[4]","1,930.00");
 
   }
 }
index 24a8883dc60a734e0117e0187c206a16fb8bb98f..02dddd851db1ff33b7b9607707088b5351c96c8c 100644 (file)
@@ -83,7 +83,7 @@ class WebTest_Pledge_StandaloneAddTest extends CiviSeleniumTestCase {
         'Send additional reminders' => '4 days after the last one sent',
       )
     );
-    $this->clickLink('_qf_PledgeView_next-bottom', "xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']", FALSE);
+    $this->clickLink('_qf_PledgeView_next-bottom', "xpath=//div[@class='view-content']//table[@class='selector row-highlight']//tbody/tr[1]/td[1]/span/a", FALSE);
     $this->click("xpath=//div[@class='view-content']//table[@class='selector row-highlight']//tbody/tr[1]/td[1]/span/a");
     $this->waitForElementPresent("xpath=//div[@class='view-content']//table//tbody/tr[2]/td[2]/table/tbody/tr[2]/td[8]/a[text()='Record Payment (Check, Cash, EFT ...)']");
   }
index ba37922251a639e6b59efc66623c84c59a6385fe..9bca83c79a87913cd2c2d2222faadbd292ba0630 100644 (file)
@@ -190,8 +190,8 @@ class WebTest_Profile_ProfileAddTest extends CiviSeleniumTestCase {
     $this->openCiviPage('group', 'reset=1');
     $this->type('title', $groupName);
     $this->click('_qf_Search_refresh');
-    $this->waitForElementPresent("xpath=//table[@id='crm-group-selector']/tbody/tr/td[contains(., '$groupName')]/following-sibling::td[@class='crm-group-group_links']/span/a");
-    $this->clickLink("xpath=//table[@id='crm-group-selector']/tbody/tr/td[1][contains(., '$groupName')]/following-sibling::td[@class='crm-group-group_links']/span/a");
+    $this->waitForElementPresent("xpath=//table[@id='crm-group-selector']/tbody/tr/td/span[text() = '$groupName']/parent::td/following-sibling::td[@class=' crm-group-group_links']/span/a");
+    $this->clickLink("xpath=//table[@id='crm-group-selector']/tbody/tr/td[1]/span[text() = '$groupName']/parent::td/following-sibling::td[@class=' crm-group-group_links']/span/a");
     $contactEmails = array(
       1 => "$lastName1, $firstName1",
       2 => "$lastName2, $firstName2"
@@ -294,11 +294,12 @@ class WebTest_Profile_ProfileAddTest extends CiviSeleniumTestCase {
     $this->assertEquals($this->getValue('description'), $profileDescription);
 
     // click on save button
-    $this->clickLink('_qf_Group_next-bottom');
+    $this->clickLink('_qf_Group_next-bottom', "xpath=//div[@id='field_page']/div[3]/a[2]", FALSE);
 
     // Wait for "saved" status msg
     $this->waitForText('crm-notification-container', 'Profile Saved');
   
+    $this->clickLink("xpath=//div[@id='breadcrumb']/div//a[text()='Profiles']");
     $this->waitForElementPresent("xpath=//div[@class='crm-submit-buttons']/a[@id='newCiviCRMProfile-bottom']");
     $this->waitForElementPresent("xpath=//div[@id='user-profiles']/div/div/table/tbody/tr[@id='UFGroup-$id']/td[2]/a");
     $this->waitForElementPresent("xpath=//div[@id='user-profiles']/div/div/table/tbody/tr[@id='UFGroup-$id']/td[3]");