From: jitendrapurohit Date: Mon, 28 Apr 2014 13:39:30 +0000 (+0530) Subject: Web Test Fix X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=0ecb50060f0cb5832f99c1d288a6e8c8ae56d73c;p=civicrm-core.git Web Test Fix --- diff --git a/tests/phpunit/WebTest/Contribute/ContactContextAddTest.php b/tests/phpunit/WebTest/Contribute/ContactContextAddTest.php index 060d4b6308..a82f030e29 100644 --- a/tests/phpunit/WebTest/Contribute/ContactContextAddTest.php +++ b/tests/phpunit/WebTest/Contribute/ContactContextAddTest.php @@ -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) { diff --git a/tests/phpunit/WebTest/Contribute/OnlineContributionTest.php b/tests/phpunit/WebTest/Contribute/OnlineContributionTest.php index 714f0cccca..f0f7d1b5d5 100644 --- a/tests/phpunit/WebTest/Contribute/OnlineContributionTest.php +++ b/tests/phpunit/WebTest/Contribute/OnlineContributionTest.php @@ -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? diff --git a/tests/phpunit/WebTest/Contribute/PCPAddTest.php b/tests/phpunit/WebTest/Contribute/PCPAddTest.php index 0bde5f9f87..ff9a5fd3f8 100755 --- a/tests/phpunit/WebTest/Contribute/PCPAddTest.php +++ b/tests/phpunit/WebTest/Contribute/PCPAddTest.php @@ -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'); diff --git a/tests/phpunit/WebTest/Contribute/UpdatePendingContributionTest.php b/tests/phpunit/WebTest/Contribute/UpdatePendingContributionTest.php index f41db6397c..338558e78c 100644 --- a/tests/phpunit/WebTest/Contribute/UpdatePendingContributionTest.php +++ b/tests/phpunit/WebTest/Contribute/UpdatePendingContributionTest.php @@ -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) { diff --git a/tests/phpunit/WebTest/Event/EventWaitListTest.php b/tests/phpunit/WebTest/Event/EventWaitListTest.php index e8d0759cb1..e2e35410a3 100644 --- a/tests/phpunit/WebTest/Event/EventWaitListTest.php +++ b/tests/phpunit/WebTest/Event/EventWaitListTest.php @@ -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); diff --git a/tests/phpunit/WebTest/Member/BatchUpdateViaProfileTest.php b/tests/phpunit/WebTest/Member/BatchUpdateViaProfileTest.php index ec94cc10d4..92bbe51311 100644 --- a/tests/phpunit/WebTest/Member/BatchUpdateViaProfileTest.php +++ b/tests/phpunit/WebTest/Member/BatchUpdateViaProfileTest.php @@ -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); }