From f8c5cf0cf66bb1a6031d75ce35d66c83dc2599c1 Mon Sep 17 00:00:00 2001 From: Web Access Date: Thu, 17 Dec 2015 20:18:05 +0530 Subject: [PATCH] tests fixes --- .../WebTest/Contribute/ContributionPageAddTest.php | 9 +++++---- .../phpunit/WebTest/Event/ParticipantCountTest.php | 2 ++ .../Pledge/ContactContextPledgePaymentAddTest.php | 4 ++-- tests/phpunit/WebTest/Report/AddTest.php | 14 +++++++------- 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/tests/phpunit/WebTest/Contribute/ContributionPageAddTest.php b/tests/phpunit/WebTest/Contribute/ContributionPageAddTest.php index 941dd52b04..1af159cd85 100644 --- a/tests/phpunit/WebTest/Contribute/ContributionPageAddTest.php +++ b/tests/phpunit/WebTest/Contribute/ContributionPageAddTest.php @@ -259,8 +259,9 @@ class WebTest_Contribute_ContributionPageAddTest extends CiviSeleniumTestCase { $this->waitForElementPresent("financial_type_id"); $this->type("sort_name", $firstName); $this->select('financial_type_id', "label=Donation"); - $this->clickLink('_qf_Search_refresh', "xpath=//table[@class='selector row-highlight']/tbody/tr[1]/td[10]/span//a[text()='View']", FALSE); - $this->clickLink("xpath=//table[@class='selector row-highlight']/tbody/tr[1]/td[10]/span//a[text()='View']", '_qf_ContributionView_cancel-bottom', FALSE); + $this->clickLink('_qf_Search_refresh', "xpath=//table[@class='selector row-highlight']/tbody/tr[1]/td[10]/span/a[1][text()='View']", FALSE); + $this->click("xpath=//table[@class='selector row-highlight']/tbody/tr[1]/td[10]/span/a[1][text()='View']"); + $this->waitForAjaxContent(); $expected = array( 'From' => "{$firstName} {$lastName}", 'Financial Type' => 'Donation', @@ -272,8 +273,8 @@ class WebTest_Contribute_ContributionPageAddTest extends CiviSeleniumTestCase { //Find Member $this->openCiviPage("member/search", "reset=1", 'member_source'); $this->type('sort_name', "$lastName $firstName"); - $this->clickLink('_qf_Search_refresh', "xpath=//div[@id='memberSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']", FALSE); - $this->clickLink("xpath=//div[@id='memberSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']", '_qf_MembershipView_cancel-bottom', FALSE); + $this->clickLink('_qf_Search_refresh', "xpath=//table[@class='selector row-highlight']/tbody/tr[1]/td[11]/span//a[text()='View']", FALSE); + $this->clickLink("xpath=//table[@class='selector row-highlight']/tbody/tr[1]/td[11]/span//a[text()='View']", '_qf_MembershipView_cancel-bottom', FALSE); //View Membership Record $expected = array( diff --git a/tests/phpunit/WebTest/Event/ParticipantCountTest.php b/tests/phpunit/WebTest/Event/ParticipantCountTest.php index 3ea4182b65..0072a69cf4 100644 --- a/tests/phpunit/WebTest/Event/ParticipantCountTest.php +++ b/tests/phpunit/WebTest/Event/ParticipantCountTest.php @@ -286,6 +286,7 @@ class WebTest_Event_ParticipantCountTest extends CiviSeleniumTestCase { // Find Participant $this->openCiviPage('event/search', 'reset=1', 'participant_fee_amount_low'); + $this->waitForElementPresent('event_id'); $this->select2("event_id", $eventTitle); $this->click('_qf_Search_refresh'); $this->waitForPageToLoad($this->getTimeoutMsec()); @@ -311,6 +312,7 @@ class WebTest_Event_ParticipantCountTest extends CiviSeleniumTestCase { $this->type('title', $setTitle); $this->check('extends[1]'); $this->select("css=select.crm-form-select", "label={$financialType}"); + $this->waitForElementPresent("help_pre"); $this->type('help_pre', 'This is test priceset.'); $this->assertChecked('is_active', 'Verify that Is Active checkbox is set.'); diff --git a/tests/phpunit/WebTest/Pledge/ContactContextPledgePaymentAddTest.php b/tests/phpunit/WebTest/Pledge/ContactContextPledgePaymentAddTest.php index f6a31cf473..d883eec0d2 100644 --- a/tests/phpunit/WebTest/Pledge/ContactContextPledgePaymentAddTest.php +++ b/tests/phpunit/WebTest/Pledge/ContactContextPledgePaymentAddTest.php @@ -428,9 +428,9 @@ class WebTest_Pledge_ContactContextPledgePaymentAddTest extends CiviSeleniumTest $this->waitForElementPresent("_qf_Contribution_upload"); $this->click("_qf_Contribution_upload"); - $this->waitForElementPresent("xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']"); + $this->waitForElementPresent("xpath=//form[@class='CRM_Pledge_Form_Search crm-search-form']/div[2]/table/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->click("xpath=//form[@class='CRM_Pledge_Form_Search crm-search-form']/div[2]/table/tbody/tr[1]/td[10]/span/a[text()='View']"); $this->waitForElementPresent("_qf_PledgeView_next-bottom"); $pledgeDate = date('F jS, Y', strtotime('now')); diff --git a/tests/phpunit/WebTest/Report/AddTest.php b/tests/phpunit/WebTest/Report/AddTest.php index d371c31f77..d82898c4a3 100644 --- a/tests/phpunit/WebTest/Report/AddTest.php +++ b/tests/phpunit/WebTest/Report/AddTest.php @@ -70,7 +70,7 @@ class WebTest_Report_AddTest extends CiviSeleniumTestCase { $this->assertElementContainsText('css=td.crm-report-civicrm_email_email', $emailId, "Email did not found!"); // check criteria - $this->click("xpath=//div[@id='mainTabContainer']/ul//li/a[text()='Filters']"); + $this->click("xpath=//div[@class='crm-report-criteria']/div[@id='mainTabContainer']/ul//li/a[text()='Filters']"); $this->waitForElementPresent("xpath=//div[@class='crm-submit-buttons']"); // Is Contact Name filter? @@ -88,7 +88,7 @@ class WebTest_Report_AddTest extends CiviSeleniumTestCase { $reportDescription = "New Contact Summary Report"; $emaiSubject = "Contact Summary Report"; $emailCC = "tesmail@example.org"; - $this->click("xpath=//div[@id='mainTabContainer']/ul//li/a[text()='Developer']"); + $this->click("xpath=//div[@class='crm-report-criteria']/div[@id='mainTabContainer']/ul//li/a[text()='Developer']"); $this->waitForElementPresent("xpath=//div[@class='crm-submit-buttons']"); $this->click("_qf_Summary_submit_save"); @@ -103,7 +103,7 @@ class WebTest_Report_AddTest extends CiviSeleniumTestCase { $this->waitForElementPresent('_qf_Summary_submit_save'); // Fill Email Subject - $this->click("xpath=//div[@id='mainTabContainer']/ul//li/a[text()='Email Delivery']"); + $this->click("xpath=//div[@class='crm-report-criteria']/div[@id='mainTabContainer']/ul//li/a[text()='Email Delivery']"); $this->waitForAjaxContent(); $this->type("email_subject", $emaiSubject); @@ -116,7 +116,7 @@ class WebTest_Report_AddTest extends CiviSeleniumTestCase { $this->type("email_cc", $emailCC); // We want navigation menu - $this->click("xpath=//div[@id='mainTabContainer']/ul//li/a[text()='Access']"); + $this->click("xpath=//div[@class='crm-report-criteria']/div[@id='mainTabContainer']/ul//li/a[text()='Access']"); $this->click("is_navigation"); // Navigation menu under Reports section @@ -165,7 +165,7 @@ class WebTest_Report_AddTest extends CiviSeleniumTestCase { $this->assertEquals("on", $this->getValue("fields[phone]")); // Check Report settings - $this->click("xpath=//div[@id='mainTabContainer']/ul/li[4]/a"); + $this->click("xpath=//div[@class='crm-report-criteria']/div[@id='mainTabContainer']/ul/li[4]/a"); $this->waitForElementPresent("title"); // Is correct Report Title? @@ -176,7 +176,7 @@ class WebTest_Report_AddTest extends CiviSeleniumTestCase { // Is correct email Subject? $this->waitForElementPresent("mainTabContainer"); - $this->click("xpath=//div[@id='mainTabContainer']/ul/li[5]/a"); + $this->click("xpath=//div[@class='crm-report-criteria']/div[@id='mainTabContainer']/ul/li[5]/a"); $this->waitForAjaxContent(); $this->assertContains($emaiSubject, $this->getValue("email_subject"), "Email Subject expected $emaiSubject"); @@ -187,7 +187,7 @@ class WebTest_Report_AddTest extends CiviSeleniumTestCase { $this->assertContains($emailCC, $this->getValue("email_cc"), "Email CC expected $emailCC"); // Is Navigation? - $this->click("xpath=//div[@id='mainTabContainer']/ul/li[6]/a"); + $this->click("xpath=//div[@class='crm-report-criteria']/div[@id='mainTabContainer']/ul/li[6]/a"); $this->assertEquals("on", $this->getValue("is_navigation")); // Is correct Navigation Parent? -- 2.25.1