<?php
require_once 'CiviTest/CiviSeleniumTestCase.php';
+
+/**
+ * Class WebTest_Event_EventListingTest
+ */
class WebTest_Event_EventListingTest extends CiviSeleniumTestCase {
protected function setUp() {
//go to manage event and check for presence of ongoing and
//upcomming events
$this->openCiviPage("event/manage", "reset=1");
- $this->type("xpath=//div[@class='crm-block crm-form-block crm-event-searchevent-form-block']/table/tbody/tr/td/input",$eventTitle1);
+ $this->type("xpath=//div[@class='crm-block crm-form-block crm-event-searchevent-form-block']/table/tbody/tr/td/input", $eventTitle1);
$this->click("_qf_SearchEvent_refresh");
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->assertFalse($this->isTextPresent("{$eventTitle1}"));
- $this->type("xpath=//div[@class='crm-block crm-form-block crm-event-searchevent-form-block']/table/tbody/tr/td/input",$eventTitle2);
+ $this->type("xpath=//div[@class='crm-block crm-form-block crm-event-searchevent-form-block']/table/tbody/tr/td/input", $eventTitle2);
$this->click("_qf_SearchEvent_refresh");
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->assertFalse($this->isTextPresent("{$eventTitle2}"));
- $this->type("xpath=//div[@class='crm-block crm-form-block crm-event-searchevent-form-block']/table/tbody/tr/td/input",$eventTitle3);
+ $this->type("xpath=//div[@class='crm-block crm-form-block crm-event-searchevent-form-block']/table/tbody/tr/td/input", $eventTitle3);
$this->click("_qf_SearchEvent_refresh");
$this->waitForPageToLoad($this->getTimeoutMsec());
- $this->assertTrue($this->isTextPresent("{$eventTitle3}"));
- $this->type("xpath=//div[@class='crm-block crm-form-block crm-event-searchevent-form-block']/table/tbody/tr/td/input",$eventTitle4);
+ $this->waitForText("SearchEvent", "{$eventTitle3}");
+ $this->type("xpath=//div[@class='crm-block crm-form-block crm-event-searchevent-form-block']/table/tbody/tr/td/input", $eventTitle4);
$this->click("_qf_SearchEvent_refresh");
$this->waitForPageToLoad($this->getTimeoutMsec());
- $this->assertTrue($this->isTextPresent("{$eventTitle4}"));
- $this->type("xpath=//div[@class='crm-block crm-form-block crm-event-searchevent-form-block']/table/tbody/tr/td/input",$eventTitle5);
+ $this->waitForText("SearchEvent", "{$eventTitle4}");
+ $this->type("xpath=//div[@class='crm-block crm-form-block crm-event-searchevent-form-block']/table/tbody/tr/td/input", $eventTitle5);
$this->click("_qf_SearchEvent_refresh");
$this->waitForPageToLoad($this->getTimeoutMsec());
- $this->assertTrue($this->isTextPresent("{$eventTitle5}"));
- $this->type("xpath=//div[@class='crm-block crm-form-block crm-event-searchevent-form-block']/table/tbody/tr/td/input","");
+ $this->waitForText("SearchEvent", "{$eventTitle5}");
+ $this->type("xpath=//div[@class='crm-block crm-form-block crm-event-searchevent-form-block']/table/tbody/tr/td/input", "");
//check if closed Event is present
$this->waitForElementPresent('CIVICRM_QFID_1_eventsByDates');
$this->click('_qf_SearchEvent_refresh');
$this->waitForPageToLoad($this->getTimeoutMsec());
- $this->assertTrue($this->isTextPresent("{$eventTitle1}"));
- $this->assertTrue($this->isTextPresent("{$eventTitle2}"));
+ $this->waitForText("option11", "{$eventTitle1}");
+ $this->waitForText("option11", "{$eventTitle2}");
$this->assertFalse($this->isTextPresent("{$eventTitle3}"));
$this->assertFalse($this->isTextPresent("{$eventTitle4}"));
$this->assertFalse($this->isTextPresent("{$eventTitle5}"));
$this->openCiviPage("event/ical", "reset=1&page=1&html=1", NULL);
$this->assertFalse($this->isTextPresent("{$eventTitle1}"));
$this->assertFalse($this->isTextPresent("{$eventTitle2}"));
- $this->assertTrue($this->isTextPresent("{$eventTitle3}"));
- $this->assertTrue($this->isTextPresent("{$eventTitle4}"));
- $this->assertTrue($this->isTextPresent("{$eventTitle5}"));
+ $this->waitForText("option11", "{$eventTitle3}");
+ $this->waitForText("option11", "{$eventTitle4}");
+ $this->waitForText("option11", "{$eventTitle5}");
//go to block listing to enable Upcomming Events Block
// you need to be admin user for below operation
$this->assertFalse($this->isTextPresent("{$eventTitle1}"));
$this->assertFalse($this->isTextPresent("{$eventTitle2}"));
$this->assertFalse($this->isTextPresent("{$eventTitle3}"));
- $this->assertTrue($this->isTextPresent("{$eventTitle4}"));
- $this->assertTrue($this->isTextPresent("{$eventTitle5}"));
+ $this->waitForText("block-civicrm-6", "{$eventTitle4}");
+ $this->waitForText("block-civicrm-6", "{$eventTitle5}");
//go to block listing to disable Upcomming Events Block
$this->open($this->sboxPath . 'admin/structure/block');
$this->waitForTextPresent("The block settings have been updated.");
}
+ /**
+ * @param $eventTitle
+ * @param $startdate
+ * @param $enddate
+ */
function _testCreateEvent($eventTitle, $startdate, $enddate) {
$this->openCiviPage("event/add", "reset=1&action=add");
$this->type("max_participants", "6");
$this->click("is_public");
- $this->click("_qf_EventInfo_upload-bottom");
-
- // Wait for Location tab form to load
- $this->waitForPageToLoad($this->getTimeoutMsec());
- $this->waitForElementPresent("_qf_Location_upload_done-bottom");
+ $this->clickLink("_qf_EventInfo_upload-bottom", "_qf_Location_upload_done-bottom");
$this->click("_qf_Location_upload_done-bottom");
// Wait for "saved" status msg
$this->waitForPageToLoad($this->getTimeoutMsec());
- $this->waitForTextPresent("'Location' information has been saved.");
+ $this->waitForText("crm-notification-container", "'Event Location' information has been saved.");
}
}
-