From: atif-shaikh Date: Fri, 13 Mar 2015 13:06:31 +0000 (+0530) Subject: WebtestFix X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=7542b691f9b45274253828bfd947669ed4205cc0;p=civicrm-core.git WebtestFix --- diff --git a/tests/phpunit/WebTest/Contribute/OfflineContributionTest.php b/tests/phpunit/WebTest/Contribute/OfflineContributionTest.php index 86fee95dd9..1c1b90514c 100644 --- a/tests/phpunit/WebTest/Contribute/OfflineContributionTest.php +++ b/tests/phpunit/WebTest/Contribute/OfflineContributionTest.php @@ -283,7 +283,7 @@ class WebTest_Contribute_OfflineContributionTest extends CiviSeleniumTestCase { 'From' => "{$firstName} {$lastName}", 'Financial Type' => 'Donation', 'Total Amount' => 123, - 'Non-deductible Amount' => '0.00', + 'Non-deductible Amount' => 123, 'sort_name' => "$lastName, $firstName", ); $this->_verifyAmounts($checkScenario4); @@ -317,11 +317,11 @@ class WebTest_Contribute_OfflineContributionTest extends CiviSeleniumTestCase { $this->waitForElementPresent("css=li#tab_contribute a"); $this->click("css=li#tab_contribute a"); - $this->waitForElementPresent("link=Submit Credit Card Contribution"); + $this->waitForElementPresent("link=Record Contribution (Check, Cash, EFT ...)"); // since we don't have live credentials we will switch to test mode - $url = $this->getAttribute("xpath=//*[@id='Search']/div[2]/div[2]/a[2]@href"); - $url = str_replace('mode=live', 'mode=test', $url); + $url = $this->getAttribute("xpath=//*[@id='Search']/div[2]/div[2]/a[1]@href"); + $url = $url.'&mode=test'; $this->open($url); $this->waitForPageToLoad($this->getTimeoutMsec()); @@ -355,7 +355,7 @@ class WebTest_Contribute_OfflineContributionTest extends CiviSeleniumTestCase { $this->select("product_name[0]", "label={$params['premium']}"); } // Clicking save. - $this->click("_qf_Contribution_upload"); + $this->click("_qf_Contribution_upload-bottom"); $this->waitForPageToLoad($this->getTimeoutMsec()); // Is status message correct? diff --git a/tests/phpunit/WebTest/Contribute/OfflineRecurContributionTest.php b/tests/phpunit/WebTest/Contribute/OfflineRecurContributionTest.php index 110e622cad..418e27e38b 100644 --- a/tests/phpunit/WebTest/Contribute/OfflineRecurContributionTest.php +++ b/tests/phpunit/WebTest/Contribute/OfflineRecurContributionTest.php @@ -51,10 +51,10 @@ class WebTest_Contribute_OfflineRecurContributionTest extends CiviSeleniumTestCa $this->click('css=li#tab_contribute a'); - $this->waitForElementPresent('link=Submit Credit Card Contribution'); + $this->waitForElementPresent('link=Record Contribution (Check, Cash, EFT ...)'); // since we don't have live credentials we will switch to test mode - $url = $this->getAttribute("xpath=//*[@id='Search']//a[text()='Submit Credit Card Contribution']@href"); - $url = str_replace('mode=live', 'mode=test', $url); + $url = $this->getAttribute("xpath=//*[@id='Search']/div[2]/div[2]/a[1]@href"); + $url = $url.'&mode=test'; $this->open($url); $this->waitForPageToLoad($this->getTimeoutMsec()); diff --git a/tests/phpunit/WebTest/Event/AdditionalPaymentTest.php b/tests/phpunit/WebTest/Event/AdditionalPaymentTest.php index a60249a853..43b21610a4 100644 --- a/tests/phpunit/WebTest/Event/AdditionalPaymentTest.php +++ b/tests/phpunit/WebTest/Event/AdditionalPaymentTest.php @@ -112,7 +112,7 @@ class WebTest_Event_AdditionalPaymentTest extends CiviSeleniumTestCase { $this->waitForElementPresent("xpath=//form[@class='CRM_Event_Form_Search crm-search-form']/table//tbody/tr[1]/td[8]/span/a[text()='View']"); //click through to the participant view screen $this->click("xpath=//form[@class='CRM_Event_Form_Search crm-search-form']/table/tbody/tr[1]/td[8]/span/a[text()='View']"); - $this->waitForElementPresent('_qf_ParticipantView_cancel-bottom'); + $this->waitForElementPresent("xpath=//button//span[contains(text(),'Done')]"); $this->webtestVerifyTabularData( array( @@ -128,7 +128,7 @@ class WebTest_Event_AdditionalPaymentTest extends CiviSeleniumTestCase { $balance = 800.00 - 400.00; //click through to the contribution view screen $this->click("xpath=id('ParticipantView')/div[2]/table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='View']"); - $this->waitForElementPresent('_qf_ContributionView_cancel-bottom'); + $this->waitForElementPresent("xpath=//button//span[contains(text(),'Done')]"); $this->webtestVerifyTabularData( array( @@ -141,19 +141,14 @@ class WebTest_Event_AdditionalPaymentTest extends CiviSeleniumTestCase { ) ); - $this->clickAjaxLink('_qf_ContributionView_cancel-top'); + $this->clickAjaxLink("xpath=//button//span[contains(text(),'Done')]"); $this->waitForElementPresent("xpath=id('ParticipantView')/div[2]/table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='View']"); // make additional payment // 1 - check for links presence on participant view and edit page - $this->assertElementPresent("xpath=id('Search')/table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span[2]/ul/li[2]/a[text()='Record Payment']"); - $this->click("xpath=id('Search')/table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='View']"); - $this->waitForElementPresent("xpath=id('ParticipantView')"); - $this->waitForElementPresent("xpath=id('ParticipantView')//td[@id='payment-info']/a/span[contains(text(), 'Record Payment')]"); - + $this->waitForElementPresent("xpath=id('ParticipantView')//td[@id='payment-info']//a[contains(text(), 'Record Payment')]"); $this->click("xpath=id('ParticipantView')//div[@class='action-link']/div/a/span[contains(text(), 'Edit')]"); - $this->waitForElementPresent("xpath=id('Participant')"); - $this->waitForElementPresent("xpath=id('Participant')//td[@id='payment-info']//a/span[contains(text(), 'Record Payment')]"); - $this->clickLinkSuppressPopup("xpath=id('Participant')//td[@id='payment-info']/a/span[contains(text(), 'Record Payment')]/../", 'AdditionalPayment'); + $this->waitForElementPresent("xpath=id('ParticipantView')//td[@id='payment-info']//a[contains(text(), 'Record Payment')]"); + $this->clickLinkSuppressPopup("xpath=id('ParticipantView')//td[@id='payment-info']//a[contains(text(), 'Record Payment')]", 'AdditionalPayment'); // verify balance $text = $this->getText("xpath=id('AdditionalPayment')/div[2]//table/tbody/tr[3]/td[2]"); @@ -168,11 +163,9 @@ class WebTest_Event_AdditionalPaymentTest extends CiviSeleniumTestCase { $this->type('total_amount', $balance); $this->click('_qf_AdditionalPayment_upload-bottom'); $this->checkCRMAlert('The payment record has been processed.'); - - $this->waitForElementPresent("xpath=id('Search')/table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='View']"); - $this->click("xpath=id('Search')/table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='View']"); - $this->waitForElementPresent("_qf_ParticipantView_cancel-top"); - + $this->waitForElementPresent("xpath=//*[contains(@class, 'CRM_Event_Form_Search')]//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='View']"); + $this->click("xpath=//*[contains(@class, 'CRM_Event_Form_Search')]//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='View']"); + $this->waitForElementPresent("xpath=//button//span[contains(text(),'Done')]"); $this->webtestVerifyTabularData( array( 'Event' => 'Rain-forest Cup Youth Soccer Tournament', @@ -185,7 +178,7 @@ class WebTest_Event_AdditionalPaymentTest extends CiviSeleniumTestCase { $this->_checkPaymentInfoTable(800.00, 800.00); // check for absence of record payment button - $this->assertFalse($this->isElementPresent("xpath=id('ParticipantView')//td[@id='payment-info']//a/span[contains(text(), 'Record Payment')]")); + $this->assertFalse($this->isElementPresent("xpath=id('ParticipantView')//td[@id='payment-info']//a[contains(text(), 'Record Payment')]")); $this->clickAjaxLink("xpath=id('ParticipantView')/div[2]/table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='View']"); @@ -199,7 +192,7 @@ class WebTest_Event_AdditionalPaymentTest extends CiviSeleniumTestCase { 'Check Number' => '1044', ) ); - $this->click('_qf_ContributionView_cancel-bottom'); + $this->click("xpath=//button//span[contains(text(),'Done')]"); // view transaction popup info check $this->waitForElementPresent("xpath=//td[@id='payment-info']/table[@id='info']/tbody/tr[2]/td[2]/a");