Webtests fixes
authorWeb Access <rohan.katkar@webaccessglobal.com>
Tue, 10 Nov 2015 13:08:18 +0000 (18:38 +0530)
committerWeb Access <rohan.katkar@webaccessglobal.com>
Tue, 10 Nov 2015 13:08:18 +0000 (18:38 +0530)
tests/phpunit/WebTest/Case/ActivityToCaseTest.php
tests/phpunit/WebTest/Contact/AdvancedSearchedRelatedContactTest.php
tests/phpunit/WebTest/Contribute/AddPricesetTest.php
tests/phpunit/WebTest/Pledge/ContactContextPledgePaymentAddTest.php
tests/phpunit/WebTest/Pledge/StandaloneAddDeleteTest.php

index 65aeb606da9cb17761d83229b310ae46a47d6116..965b3ebf9b2392bcc2ffb9fb17a056e2ea1b6add 100644 (file)
@@ -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");
index 3f8ffeae4f3c5dfa70fa350e409f42219b92f898..8a980f1cad6a8a7a293f928eb1304f1ecb303db7 100644 (file)
@@ -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");
 
index fa8b8c5cc8a89e9c1925370afb3ba72cd86ff5e1..125470841fb970fd113ff846fb3f8940cd79d042 100644 (file)
@@ -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');
index 34d0f76f492ba2b7602aa96f692f9a778ee3a82a..581ece384fdc96de905b6fa892f7aa5aa6bc6fdd 100644 (file)
@@ -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");
index 6130afc714b85237f989b9aba21239f8a7ce2f6e..866ce8a7c6dd4b7d0c8750296506ba605eb3ef28 100644 (file)
@@ -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']");