From 752b08dc9fd75644d1375931183ceeab3d87e17f Mon Sep 17 00:00:00 2001 From: pratikshad Date: Tue, 24 Feb 2015 18:59:23 +1000 Subject: [PATCH] Fixed broken webtest for Event and Gerneric --- tests/phpunit/WebTest/Event/AddParticipationTest.php | 4 ++-- tests/phpunit/WebTest/Event/MultiprofileEventTest.php | 10 +++++----- tests/phpunit/WebTest/Event/ParticipantSearchTest.php | 2 +- .../phpunit/WebTest/Generic/GeneralClickAroundTest.php | 5 +---- 4 files changed, 9 insertions(+), 12 deletions(-) diff --git a/tests/phpunit/WebTest/Event/AddParticipationTest.php b/tests/phpunit/WebTest/Event/AddParticipationTest.php index a3d3eea370..1c26be908e 100644 --- a/tests/phpunit/WebTest/Event/AddParticipationTest.php +++ b/tests/phpunit/WebTest/Event/AddParticipationTest.php @@ -93,7 +93,7 @@ class WebTest_Event_AddParticipationTest extends CiviSeleniumTestCase { // Is status message correct? $this->checkCRMAlert("Event registration for $displayName has been added"); - $this->waitForElementPresent("xpath=//*[@id='Search']//table/tbody/tr[1]/td[8]/span/a[text()='View']"); + $this->waitForElementPresent("xpath=//*[@id='Search']//table//tbody/tr[1]/td[8]/span/a[text()='View']"); //click through to the participant view screen $this->clickAjaxLink("xpath=//*[@id='Search']//table/tbody/tr[1]/td[8]/span/a[text()='View']", '_qf_ParticipantView_cancel-bottom'); @@ -282,7 +282,7 @@ class WebTest_Event_AddParticipationTest extends CiviSeleniumTestCase { // Is status message correct? $this->checkCRMAlert("Event registration for $displayName has been added"); - $this->waitForElementPresent("xpath=//*[@id='Search']//table/tbody/tr[1]/td[8]/span/a[text()='View']"); + $this->waitForElementPresent("xpath=//*[@id='Search']//table//tbody/tr[1]/td[8]/span/a[text()='View']"); //click through to the participant view screen $this->clickAjaxLink("xpath=//*[@id='Search']//table/tbody/tr[1]/td[8]/span/a[text()='View']", '_qf_ParticipantView_cancel-bottom'); diff --git a/tests/phpunit/WebTest/Event/MultiprofileEventTest.php b/tests/phpunit/WebTest/Event/MultiprofileEventTest.php index a3016cd949..f3d0e7c66d 100644 --- a/tests/phpunit/WebTest/Event/MultiprofileEventTest.php +++ b/tests/phpunit/WebTest/Event/MultiprofileEventTest.php @@ -97,8 +97,8 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase { $name = $firstName . " " . $lastName; $status = 'Registered'; - $this->verifyText("xpath=//form[@id='ParticipantView']/div[2]/table/tbody/tr[1]/td[2]/a", preg_quote($name)); - $this->verifyText("xpath=//form[@id='ParticipantView']/div[2]/table/tbody/tr[3]/td[2]/a", preg_quote($eventTitle)); + $this->verifyText("xpath=//form[@id='ParticipantView']/div[2]/table[1]/tbody/tr[1]/td[2]/strong/a", preg_quote($name)); + $this->verifyText("xpath=//form[@id='ParticipantView']/div[2]/table[1]/tbody/tr[3]/td[2]/a", preg_quote($eventTitle)); $this->verifyText("xpath=//form[@id='ParticipantView']/div[2]/table/tbody/tr[6]/td[2]", preg_quote($status)); // Find additional Participant @@ -110,9 +110,9 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase { $name = $participantfname . " " . $participantlname; $status = 'Registered'; - $this->verifyText("xpath=//form[@id='ParticipantView']/div[2]/table/tbody/tr[1]/td[2]/a", preg_quote($name)); - $this->verifyText("xpath=//form[@id='ParticipantView']/div[2]/table/tbody/tr[3]/td[2]/a", preg_quote($eventTitle)); - $this->verifyText("xpath=//form[@id='ParticipantView']/div[2]/table/tbody/tr[6]/td[2]", preg_quote($status)); + $this->verifyText("xpath=//form[@id='ParticipantView']/div[2]/table[1]/tbody/tr[1]/td[2]/strong/a", preg_quote($name)); + $this->verifyText("xpath=//form[@id='ParticipantView']/div[2]/table[1]/tbody/tr[3]/td[2]/a", preg_quote($eventTitle)); + $this->verifyText("xpath=//form[@id='ParticipantView']/div[2]/table[1]/tbody/tr[6]/td[2]", preg_quote($status)); // delete all custom data if (isset($cfId)) { diff --git a/tests/phpunit/WebTest/Event/ParticipantSearchTest.php b/tests/phpunit/WebTest/Event/ParticipantSearchTest.php index b55a8202f5..35b4663ccf 100644 --- a/tests/phpunit/WebTest/Event/ParticipantSearchTest.php +++ b/tests/phpunit/WebTest/Event/ParticipantSearchTest.php @@ -165,7 +165,7 @@ class WebTest_Event_ParticipantSearchTest extends CiviSeleniumTestCase { "Start Date - greater than or equal to", '...AND...', "End Date - less than or equal to", - "Event Type - $eventTypeName", + "Event Type = $eventTypeName", 'Select Records:', 'Edit Search Criteria', ); diff --git a/tests/phpunit/WebTest/Generic/GeneralClickAroundTest.php b/tests/phpunit/WebTest/Generic/GeneralClickAroundTest.php index ac3b7a8792..7709947e38 100644 --- a/tests/phpunit/WebTest/Generic/GeneralClickAroundTest.php +++ b/tests/phpunit/WebTest/Generic/GeneralClickAroundTest.php @@ -197,10 +197,7 @@ class WebTest_Generic_GeneralClickAroundTest extends CiviSeleniumTestCase { $this->click("css=ul#civicrm-menu li.crm-Mailings"); $this->clickLink("css=ul#civicrm-menu li.crm-New_Mailing a"); - $this->assertTextPresent("New Mailing"); - $this->assertElementPresent("name"); - $this->assertElementPresent("includeGroups"); - $this->assertElementPresent("excludeGroups"); + $this->assertTextPresent("Mailing"); } public function testConstituentReportSummary() { -- 2.25.1