From 35f01dcbbb9fbf291a4732462f477efc7e1de024 Mon Sep 17 00:00:00 2001 From: Web Access Date: Tue, 10 Nov 2015 18:38:18 +0530 Subject: [PATCH] Webtests fixes --- tests/phpunit/WebTest/Case/ActivityToCaseTest.php | 5 ++--- .../Contact/AdvancedSearchedRelatedContactTest.php | 4 ++-- tests/phpunit/WebTest/Contribute/AddPricesetTest.php | 8 ++++---- .../Pledge/ContactContextPledgePaymentAddTest.php | 3 +-- tests/phpunit/WebTest/Pledge/StandaloneAddDeleteTest.php | 9 +++++---- 5 files changed, 14 insertions(+), 15 deletions(-) diff --git a/tests/phpunit/WebTest/Case/ActivityToCaseTest.php b/tests/phpunit/WebTest/Case/ActivityToCaseTest.php index 65aeb606da..965b3ebf9b 100644 --- a/tests/phpunit/WebTest/Case/ActivityToCaseTest.php +++ b/tests/phpunit/WebTest/Case/ActivityToCaseTest.php @@ -301,7 +301,7 @@ class WebTest_Case_ActivityToCaseTest extends CiviSeleniumTestCase { $this->select2('file_on_case_unclosed_case_id', $firstName); $this->assertElementContainsText("xpath=//div[@id='s2id_file_on_case_unclosed_case_id']", "$firstName", 'Contact not found in line ' . __LINE__); $this->type('file_on_case_activity_subject', $subject); - $this->click("xpath=//div[@class='ui-dialog-buttonset']/button/span[text()='Save']"); + $this->click("xpath=//div[@class='ui-dialog-buttonset']//button//span[text()='Save']"); $this->waitForElementPresent("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody//tr/td[5]/a[text()='Summerson, $firstName1']/../../td[8]/span/a[1][text()='View']"); // verify if custom data is present @@ -311,8 +311,7 @@ class WebTest_Case_ActivityToCaseTest extends CiviSeleniumTestCase { $this->waitForElementPresent('_qf_CaseView_cancel-bottom'); $id = $this->urlArg('id'); $this->waitForElementPresent("xpath=//div[@id='activities']//table[@id='case_id_" . $id . "']/tbody/tr[1]/td[2]"); - - $this->click("xpath=//div[@id='activities']//table[@id='case_id_" . $id . "']/tbody/tr[1]/td[2]/div[text()='{$subject}']/../../td[8]/a[1]"); + $this->click("xpath=//table[@id='case_id_" . $id . "']/tbody/tr[1]/td[2]/div[text()='{$subject}']/../../td[8]/a[text()='View']"); $this->waitForElementPresent('ActivityView'); $this->waitForElementPresent("css=table#crm-activity-view-table tr.crm-case-activityview-form-block-groupTitle"); diff --git a/tests/phpunit/WebTest/Contact/AdvancedSearchedRelatedContactTest.php b/tests/phpunit/WebTest/Contact/AdvancedSearchedRelatedContactTest.php index 3f8ffeae4f..8a980f1cad 100644 --- a/tests/phpunit/WebTest/Contact/AdvancedSearchedRelatedContactTest.php +++ b/tests/phpunit/WebTest/Contact/AdvancedSearchedRelatedContactTest.php @@ -92,10 +92,10 @@ class WebTest_Contact_AdvancedSearchedRelatedContactTest extends CiviSeleniumTes $this->openCiviPage('contact/search', 'reset=1', '_qf_Basic_refresh'); $this->type("sort_name", $sortName); $this->select("contact_type", "value=Individual"); - $this->clickLink("_qf_Basic_refresh", "xpath=//form[@id='Basic']//div/div//div/table/tbody/tr/"); + $this->clickLink("_qf_Basic_refresh", "xpath=//form[@id='Basic']//div/div//div/table/tbody/tr/", FALSE); // click through to the Relationship view screen - $this->click("xpath=//form[@id='Basic']//div/div//div/table/tbody/tr/td[11]/span/a[text()='View']"); + $this->click("xpath=//div[@class='crm-search-results']/table[@class='selector row-highlight']/tbody//tr/td[11]/span/a[text()='View']"); $this->waitForPageToLoad($this->getTimeoutMsec()); $this->click("css=li#tab_participant a"); diff --git a/tests/phpunit/WebTest/Contribute/AddPricesetTest.php b/tests/phpunit/WebTest/Contribute/AddPricesetTest.php index fa8b8c5cc8..125470841f 100644 --- a/tests/phpunit/WebTest/Contribute/AddPricesetTest.php +++ b/tests/phpunit/WebTest/Contribute/AddPricesetTest.php @@ -282,11 +282,10 @@ class WebTest_Contribute_AddPricesetTest extends CiviSeleniumTestCase { // Is status message correct? $this->assertTrue($this->isTextPresent('The contribution record has been saved.'), "Status message didn't show up after saving!"); - - $this->waitForElementPresent("xpath=//div[@class='view-content']//table[@class='selector row-highlight']//tbody/tr[1]/td[8]/span/a[text()='View']"); + $this->waitForElementPresent("xpath=//table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span/a[text()='View']"); //click through to the Membership view screen - $this->click("xpath=//div[@class='view-content']//table[@class='selector row-highlight']//tbody/tr[1]/td[8]/span/a[text()='View']"); + $this->click("xpath=//table[@class='selector row-highlight']//tbody/tr[1]/td[8]/span//a[text()='View']"); $this->waitForElementPresent('_qf_ContributionView_cancel-bottom'); $expected = array( 2 => $financialType, @@ -429,7 +428,7 @@ class WebTest_Contribute_AddPricesetTest extends CiviSeleniumTestCase { // View Contribution Record and test for expected values $expected = array( - 'From' => "{$email}", + 'From' => "{$firstName} {$lastName}", 'Financial Type' => $financialType, // as per changes made in CRM-15407 'Fee Amount' => '$ 1.50', @@ -491,6 +490,7 @@ class WebTest_Contribute_AddPricesetTest extends CiviSeleniumTestCase { $pageId = $this->urlArg('id'); //this contribution page for online contribution + $this->waitForElementPresent("xpath=//tr[@class='crm-contribution-contributionpage-amount-form-block-payment_processor']/td"); $this->click("xpath=//tr[@class='crm-contribution-contributionpage-amount-form-block-payment_processor']/td/label[text()='$processorName']"); $this->select('price_set_id', 'label=' . $setTitle); $this->clickLink('_qf_Amount_next-bottom'); diff --git a/tests/phpunit/WebTest/Pledge/ContactContextPledgePaymentAddTest.php b/tests/phpunit/WebTest/Pledge/ContactContextPledgePaymentAddTest.php index 34d0f76f49..581ece384f 100644 --- a/tests/phpunit/WebTest/Pledge/ContactContextPledgePaymentAddTest.php +++ b/tests/phpunit/WebTest/Pledge/ContactContextPledgePaymentAddTest.php @@ -94,8 +94,7 @@ class WebTest_Pledge_ContactContextPledgePaymentAddTest extends CiviSeleniumTest $this->waitForElementPresent('link=Add Pledge'); $this->waitForText('crm-notification-container', "Pledge has been recorded and the payment schedule has been created."); - - $this->waitForElementPresent("xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']"); + $this->waitForElementPresent("xpath=//table[@class='selector row-highlight']//tbody/tr[1]/td[10]/span/a[text()='View']"); //click through to the Pledge view screen $this->click("xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']"); $this->waitForElementPresent("_qf_PledgeView_next-bottom"); diff --git a/tests/phpunit/WebTest/Pledge/StandaloneAddDeleteTest.php b/tests/phpunit/WebTest/Pledge/StandaloneAddDeleteTest.php index 6130afc714..866ce8a7c6 100644 --- a/tests/phpunit/WebTest/Pledge/StandaloneAddDeleteTest.php +++ b/tests/phpunit/WebTest/Pledge/StandaloneAddDeleteTest.php @@ -114,10 +114,11 @@ class WebTest_Pledge_StandaloneAddDeleteTest extends CiviSeleniumTestCase { $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[@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("xpath=//div[@class='ui-dialog-buttonset']//button//span[text()='Delete']"); + $this->click("xpath=//div[@class='ui-dialog-buttonset']//button//span[text()='Delete']"); + $this->waitForElementPresent("xpath=//div[@class='ui-dialog-buttonset']//button//span[text()='Delete']"); + $this->click("xpath=//div[@class='ui-dialog-buttonset']//button//span[text()='Delete']"); + $this->waitForElementPresent("xpath=//li[@id='tab_pledge']/a"); $this->click("xpath=//li[@id='tab_pledge']/a"); $this->waitForElementPresent("xpath=//div[@class='view-content']//table[@class='selector row-highlight']//tbody/tr[1]/td[10]/span/a[text()='View']"); -- 2.25.1