Web Test Fix
authorjitendrapurohit <jitendra.purohit@webaccess.co.in>
Mon, 28 Apr 2014 13:39:30 +0000 (19:09 +0530)
committerjitendrapurohit <jitendra.purohit@webaccess.co.in>
Mon, 28 Apr 2014 13:39:30 +0000 (19:09 +0530)
tests/phpunit/WebTest/Contribute/ContactContextAddTest.php
tests/phpunit/WebTest/Contribute/OnlineContributionTest.php
tests/phpunit/WebTest/Contribute/PCPAddTest.php
tests/phpunit/WebTest/Contribute/UpdatePendingContributionTest.php
tests/phpunit/WebTest/Event/EventWaitListTest.php
tests/phpunit/WebTest/Member/BatchUpdateViaProfileTest.php

index 060d4b6308529078835781b5c0b62704cac6c33e..a82f030e29aa1f91dbcbecdd5daf4d8defd2afa3 100644 (file)
@@ -107,7 +107,8 @@ class WebTest_Contribute_ContactContextAddTest extends CiviSeleniumTestCase {
     $this->type("trxn_id", "P20901X1" . rand(100, 10000));
 
     // soft credit
-    $this->webtestFillAutocomplete("{$softCreditLname}, {$softCreditFname}", 'soft_credit_contact_1');
+    $this->webtestFillAutocomplete("{$softCreditLname}, {$softCreditFname}", 'soft_credit_contact_id_1');
+    $this->type("soft_credit_amount_1", "100");
 
     //Custom Data
     //$this->waitForElementPresent('CIVICRM_QFID_3_6');
@@ -123,15 +124,6 @@ class WebTest_Contribute_ContactContextAddTest extends CiviSeleniumTestCase {
     $this->type("invoice_id", time());
     $this->webtestFillDate('thankyou_date');
 
-    //Honoree section
-    $this->click("Honoree");
-    $this->waitForElementPresent("honor_email");
-
-    $this->click("CIVICRM_QFID_1_2");
-    $this->select("honor_prefix_id", "label=Ms.");
-    $this->type("honor_first_name", "Foo");
-    $this->type("honor_last_name", "Bar");
-    $this->type("honor_email", "foo@bar.com");
 
     //Premium section
     $this->click("Premium");
@@ -145,10 +137,10 @@ class WebTest_Contribute_ContactContextAddTest extends CiviSeleniumTestCase {
     // Is status message correct?
     $this->waitForText('crm-notification-container', "The contribution record has been saved");
 
-    $this->waitForElementPresent("xpath=//div[@id='Contributions']//table/tbody/tr/td[8]/span/a[text()='View']");
+    $this->waitForElementPresent("xpath=//div[@class='view-content']/table[2]/tbody/tr/td[8]/span/a[text()='View']");
 
     // click through to the Contribution view screen
-    $this->click("xpath=//div[@id='Contributions']//table/tbody/tr/td[8]/span/a[text()='View']");
+    $this->click("xpath=//div[@class='view-content']/table[2]/tbody/tr/td[8]/span/a[text()='View']");
     $this->waitForElementPresent('_qf_ContributionView_cancel-bottom');
 
     // verify Contribution created. Non-deductible amount derived from market value of selected 'sample' coffee mug premium (CRM-11956)
@@ -189,9 +181,9 @@ class WebTest_Contribute_ContactContextAddTest extends CiviSeleniumTestCase {
 
     // verify soft credit details
     $expected = array(
-      3 => 'Donation',
+      4 => 'Donation',
       2 => '100.00',
-      5 => 'Completed',
+      6 => 'Completed',
       1 => "{$firstName} Anderson",
     );
     foreach ($expected as $value => $label) {
index 714f0ccccab5f205ed9497addcaa3094ac457952..f0f7d1b5d5d09eca65a77c6a2daaf2042317c337 100644 (file)
@@ -163,10 +163,10 @@ class WebTest_Contribute_OnlineContributionTest extends CiviSeleniumTestCase {
     $this->typeKeys("css=input#sort_name_navigation", $honorSortName);
 
     // wait for result list
-    $this->waitForElementPresent("css=div.ac_results-inner li");
+    $this->waitForElementPresent("css=ul.ui-autocomplete li");
 
     // visit contact summary page
-    $this->click("css=div.ac_results-inner li");
+    $this->click("css=ul.ui-autocomplete li");
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
     // Is contact present?
index 0bde5f9f87ed49e2594d1dcd5cc4bc284f02c099..ff9a5fd3f87339e797c023d179e01b65f8eef44c 100755 (executable)
@@ -194,7 +194,7 @@ class WebTest_Contribute_PCPAddTest extends CiviSeleniumTestCase {
 
     //Check for SoftCredit
     $softCreditor = "{$firstName} {$lastName}";
-    $this->verifyText("xpath=//table[@class='crm-info-panel crm-soft-credit-listing']/tbody/tr/td[1]", preg_quote($softCreditor), 'In line ' . __LINE__);
+    $this->verifyText("xpath=//div['PCPView']/div[2]/table[@class='crm-info-panel']/tbody/tr[2]/td[2]/a", preg_quote($softCreditor), 'In line ' . __LINE__);
   
     // Check PCP Summary Report
     $this->openCiviPage('report/instance/16', 'reset=1');
index f41db6397ca6e56ee1a03c86114d464b516f3fdf..338558e78c9f7cf16200e0fd844a70f3b9938a2c 100644 (file)
@@ -106,8 +106,8 @@ class WebTest_Contribute_UpdatePendingContributionTest extends CiviSeleniumTestC
     $this->type("trxn_id", "P20901X1" . rand(100, 10000));
 
     // soft credit
-    $this->webtestFillAutocomplete("{$softCreditLname}, {$softCreditFname}", 'soft_credit_contact_1');
-
+    $this->webtestFillAutocomplete("{$softCreditLname}, {$softCreditFname}", 'soft_credit_contact_id_1');
+    $this->type("soft_credit_amount_1", "100");
     //Custom Data
     //$this->click('CIVICRM_QFID_3_6');
 
@@ -122,15 +122,6 @@ class WebTest_Contribute_UpdatePendingContributionTest extends CiviSeleniumTestC
     $this->type("invoice_id", time());
     $this->webtestFillDate('thankyou_date');
 
-    //Honoree section
-    $this->click("Honoree");
-    $this->waitForElementPresent("honor_email");
-
-    $this->click("CIVICRM_QFID_1_2");
-    $this->select("honor_prefix_id", "label=Ms.");
-    $this->type("honor_first_name", "Foo");
-    $this->type("honor_last_name", "Bar");
-    $this->type("honor_email", "foo@bar.com");
 
     //Premium section
     $this->click("Premium");
@@ -147,10 +138,10 @@ class WebTest_Contribute_UpdatePendingContributionTest extends CiviSeleniumTestC
     $this->assertTrue($this->isTextPresent("The contribution record has been saved."), "Status message didn't show up after saving!");
 
     // verify if Contribution is created
-    $this->waitForElementPresent("xpath=//div[@id='Contributions']//table//tbody/tr[1]/td[8]/span/a[text()='View']");
+    $this->waitForElementPresent("xpath=//div[@class='view-content']//table[2]//tbody/tr[1]/td[8]/span/a[text()='View']");
 
     //click through to the Contribution view screen
-    $this->click("xpath=//div[@id='Contributions']//table/tbody/tr[1]/td[8]/span/a[text()='View']");
+    $this->click("xpath=//div[@class='view-content']//table[2]/tbody/tr[1]/td[8]/span/a[text()='View']");
     $this->waitForElementPresent("_qf_ContributionView_cancel-bottom");
 
     // View Contribution Record and test for expected values
@@ -173,9 +164,9 @@ class WebTest_Contribute_UpdatePendingContributionTest extends CiviSeleniumTestC
 
     // verify soft credit details
     $expected = array(
-      3 => 'Donation',
+      4 => 'Donation',
       2 => '100.00',
-      5 => 'Pending',
+      6 => 'Pending',
       1 => "{$firstName} Contributor",
     );
     foreach ($expected as $value => $label) {
index e8d0759cb1692f69db76cf1114f25c51a4ca31c2..e2e35410a3c98bdf31c9dd71768af7197aa65212 100644 (file)
@@ -81,8 +81,8 @@ class WebTest_Event_EventWaitListTest extends CiviSeleniumTestCase {
     $this->click("_qf_Location_upload-bottom");
 
     // Wait for "saved" status msg
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForTextPresent("'Location' information has been saved.");
+    $this->waitForElementPresent("_qf_Location_upload-bottom");
+    $this->waitForTextPresent("'Event Location' information has been saved.");
 
     // Go to Fees tab
     $this->click("link=Fees");
@@ -101,8 +101,8 @@ class WebTest_Event_EventWaitListTest extends CiviSeleniumTestCase {
     $this->click("_qf_Fee_upload-bottom");
 
     // Wait for "saved" status msg
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForTextPresent("'Fee' information has been saved.");
+    $this->waitForElementPresent("_qf_Fee_upload-bottom");
+    $this->waitForTextPresent("'Fees' information has been saved.");
 
     // intro text for registration page
     $registerIntro = "Fill in all the fields below and click Continue.";
@@ -127,8 +127,8 @@ class WebTest_Event_EventWaitListTest extends CiviSeleniumTestCase {
     $this->type("confirm_from_email", "jane.doe@example.org");
 
     $this->click("_qf_Registration_upload-bottom");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForTextPresent("'Registration' information has been saved.");
+    $this->waitForElementPresent("_qf_Registration_upload-bottom");
+    $this->waitForTextPresent("'Online Registration' information has been saved.");
 
     $eventInfoStrings = array($eventTitle, $eventDescription, $streetAddress);
     $this->_testVerifyEventInfo($eventTitle, $eventInfoStrings);
index ec94cc10d4eed64c96d5985d0bbeb016afaec112..92bbe513119ce8d9748b586813f757af3239904a 100644 (file)
@@ -97,7 +97,7 @@ class WebTest_Member_BatchUpdateViaProfileTest extends CiviSeleniumTestCase {
 
     $this->type('sort_name', $lastName);
     $this->click('_qf_Search_refresh');
-    $this->waitForElementPresent('_qf_Search_next_print');
+    $this->waitForElementPresent('Go');
 
     // Batch Update Via Profile
     $this->click("xpath=//div[@id='search-status']/table/tbody/tr[2]/td[2]/input");
@@ -119,7 +119,7 @@ class WebTest_Member_BatchUpdateViaProfileTest extends CiviSeleniumTestCase {
     $this->click('_qf_Batch_next-bottom');
     $this->waitForElementPresent('_qf_Result_done');
     $this->click('_qf_Result_done');
-    $this->waitForElementPresent('_qf_Search_next_print');
+    $this->waitForElementPresent('Go');
 
     // View Membership
     $this->click("xpath=//div[@id='memberSearch']/table/tbody//tr/td[3]/a[text()='{$Name1}']/../../td[11]/span/a[text()='View']");
@@ -134,7 +134,7 @@ class WebTest_Member_BatchUpdateViaProfileTest extends CiviSeleniumTestCase {
     $this->webtestVerifyTabularData($verifyData);
 
     $this->click('_qf_MembershipView_cancel-bottom');
-    $this->waitForElementPresent('_qf_Search_next_print');
+    $this->waitForElementPresent('Go');
 
     // View Membership
     $this->click("xpath=//div[@id='memberSearch']/table/tbody//tr/td[3]/a[text()='{$Name2}']/../../td[11]/span/a[text()='View']");
@@ -191,6 +191,7 @@ class WebTest_Member_BatchUpdateViaProfileTest extends CiviSeleniumTestCase {
     // Add membership custom data field to profile
     $this->waitForElementPresent('_qf_Group_cancel-bottom');
     $this->type('title', $profileTitle);
+    $this->click('uf_group_type_Profile');
     $this->click('_qf_Group_next-bottom');
 
     $this->waitForElementPresent('_qf_Field_cancel-bottom');
@@ -257,7 +258,7 @@ class WebTest_Member_BatchUpdateViaProfileTest extends CiviSeleniumTestCase {
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
     //Is custom field created
-    $this->waitForText('crm-notification-container', "Your custom field '$textFieldLabel' has been saved.");
+    $this->waitForText('crm-notification-container', "Custom field '$textFieldLabel' has been saved.");
 
     return array($textFieldLabel, $customGroupTitle);
   }