From bfb4aadb5d3c8d531d1c985ebc1f488371bbab03 Mon Sep 17 00:00:00 2001 From: Web Access Date: Fri, 20 Nov 2015 18:25:45 +0530 Subject: [PATCH] Webtests Fixes --- .../WebTest/Activity/ContactContextAddTest.php | 2 +- .../WebTest/Campaign/SurveyUsageScenarioTest.php | 3 ++- .../phpunit/WebTest/Contact/MergeContactsTest.php | 1 + .../WebTest/Pledge/StandaloneAddDeleteTest.php | 14 +++++++++----- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/tests/phpunit/WebTest/Activity/ContactContextAddTest.php b/tests/phpunit/WebTest/Activity/ContactContextAddTest.php index af0c801153..fce3cfb269 100644 --- a/tests/phpunit/WebTest/Activity/ContactContextAddTest.php +++ b/tests/phpunit/WebTest/Activity/ContactContextAddTest.php @@ -118,7 +118,7 @@ class WebTest_Activity_ContactContextAddTest extends CiviSeleniumTestCase { $this->waitForElementPresent("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr[2]/td[8]/span[1]/a[1][text()='View']"); // click through to the Activity view screen - $this->click("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr[2]/td[8]/span[1]/a[1][text()='View']"); + $this->click("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody//tr//td/div[text()='$subject']/../../td[8]/span[1]/a[1][text()='View']"); $this->waitForElementPresent('_qf_Activity_cancel-bottom'); // verify Activity created diff --git a/tests/phpunit/WebTest/Campaign/SurveyUsageScenarioTest.php b/tests/phpunit/WebTest/Campaign/SurveyUsageScenarioTest.php index 734aef7def..611388bfdf 100644 --- a/tests/phpunit/WebTest/Campaign/SurveyUsageScenarioTest.php +++ b/tests/phpunit/WebTest/Campaign/SurveyUsageScenarioTest.php @@ -442,6 +442,7 @@ class WebTest_Campaign_SurveyUsageScenarioTest extends CiviSeleniumTestCase { $this->type("max_number_of_contacts", 100); // release frequency + $this->waitForElementPresent('release_frequency'); $this->type("release_frequency", 2); $this->click("_qf_Main_upload-bottom"); @@ -556,7 +557,7 @@ class WebTest_Campaign_SurveyUsageScenarioTest extends CiviSeleniumTestCase { // Because it tends to cause problems, all uses of sleep() must be justified in comments // Sleep should never be used for wait for anything to load from the server // Justification for this instance: FIXME - sleep(3); + $this->waitForAjaxContent(); // Survey Report $this->openCiviPage("report/survey/detail", "reset=1", '_qf_SurveyDetails_submit'); diff --git a/tests/phpunit/WebTest/Contact/MergeContactsTest.php b/tests/phpunit/WebTest/Contact/MergeContactsTest.php index 228ea1973d..fd0f6811c9 100644 --- a/tests/phpunit/WebTest/Contact/MergeContactsTest.php +++ b/tests/phpunit/WebTest/Contact/MergeContactsTest.php @@ -838,6 +838,7 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase { $this->select('relationship_type_id', "value=5_b_a"); //fill in the individual + $this->waitForElementPresent('related_contact_id'); $this->select2('related_contact_id', $sortName, TRUE, FALSE); $this->waitForElementPresent("_qf_Relationship_upload"); diff --git a/tests/phpunit/WebTest/Pledge/StandaloneAddDeleteTest.php b/tests/phpunit/WebTest/Pledge/StandaloneAddDeleteTest.php index 866ce8a7c6..c6e9fb5665 100644 --- a/tests/phpunit/WebTest/Pledge/StandaloneAddDeleteTest.php +++ b/tests/phpunit/WebTest/Pledge/StandaloneAddDeleteTest.php @@ -114,11 +114,12 @@ 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=//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=//div[@class='ui-dialog-buttonset']/button[2]"); + $this->click("xpath=//div[@class='ui-dialog-buttonset']/button[2]"); + $this->waitForElementPresent("xpath=//div[@class='ui-dialog-buttonset']//button/span[text()='Delete']"); + $this->waitForAjaxContent(); + $this->click("xpath=//div[@class='ui-dialog-buttonset']//button/span[text()='Delete']"); + $this->waitForAjaxContent(); $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']"); @@ -126,12 +127,15 @@ 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/tbody/tr[2]/td[2]/table/tbody/tr[3]/td[7]"); + $this->waitForAjaxContent(); $this->verifyText("xpath=//div[@class='view-content']//table/tbody/tr[2]/td[2]/table/tbody/tr[3]/td[7]", "Pending"); $this->waitForElementPresent("xpath=//div[@class='view-content']//table/tbody/tr[2]/td[2]/table/tbody/tr[3]/td"); // verify that payment owed amount is correct (250.00) + $this->waitForAjaxContent(); $this->verifyText("xpath=//div[@class='view-content']//table/tbody/tr[2]/td[2]/table/tbody/tr[3]/td", "250.00"); // verify that Total Paid and Balance sums are correct + $this->waitForAjaxContent(); $this->verifyText("xpath=//div[@class='view-content' and contains(., 'view pledge payments')]/table[@class='selector row-highlight']//tbody/tr[1]/td[3]", "470.00"); $this->verifyText("xpath=//div[@class='view-content' and contains(., 'view pledge payments')]/table[@class='selector row-highlight']//tbody/tr[1]/td[4]", "1,930.00"); -- 2.25.1