require_once 'CiviTest/CiviSeleniumTestCase.php';
class WebTest_Profile_BatchUpdateTest extends CiviSeleniumTestCase {
- protected $captureScreenshotOnFailure = FALSE;
- protected $screenshotPath = '/var/www/api.dev.civicrm.org/public/sc';
- protected $screenshotUrl = 'http://api.dev.civicrm.org/sc/';
-
protected function setUp() {
parent::setUp();
}
// Add new individual using Quick Add block on the main page
$firstName1 = "John_" . substr(sha1(rand()), 0, 7);
- $lastName1 = "Smiths_x" . substr(sha1(rand()), 0, 7);
- $Name1 = $lastName1 . ', ' . $firstName1;
+ $lastName1 = "Smiths_x" . substr(sha1(rand()), 0, 7);
+ $Name1 = $lastName1 . ', ' . $firstName1;
$this->webtestAddContact($firstName1, $lastName1, "$firstName1.$lastName1@example.com");
$this->waitForPageToLoad($this->getTimeoutMsec());
// Add new individual using Quick Add block on the main page
$firstName2 = "James_" . substr(sha1(rand()), 0, 7);
- $lastName2 = "Smiths_x" . substr(sha1(rand()), 0, 7);
+ $lastName2 = "Smiths_x" . substr(sha1(rand()), 0, 7);
$Name2 = $lastName2 . ', ' . $firstName2;
$firstName3 = "James_" . substr(sha1(rand()), 0, 7);
- $lastName3 = "Smiths_x" . substr(sha1(rand()), 0, 7);
+ $lastName3 = "Smiths_x" . substr(sha1(rand()), 0, 7);
$Name3 = $lastName3 . ', ' . $firstName3;
$this->webtestAddContact($firstName2, $lastName2, "$firstName2.$lastName2@example.com", "Student");
$this->webtestAddContact($firstName3, $lastName3, "$firstName3.$lastName3@example.com", "Staff");
$this->waitForPageToLoad($this->getTimeoutMsec());
- $profileTitle = 'Batch Profile test_' . substr(sha1(rand()), 0, 7);
+ $profileTitle = 'Batch Profile test_' . substr(sha1(rand()), 0, 7);
$profileFields = array(
array(
'type' => 'Individual',
// Find contact and assert for contact sub type
$this->openCiviPage('contact/search', 'reset=1', '_qf_Basic_refresh');
- $this->type('sort_name', $firstName2);
+ $this->type('sort_name', $firstName2);
$this->click('_qf_Basic_refresh');
$this->waitForElementPresent("xpath=//div[@class='crm-search-results']/table/tbody//td/span/a[text()='View']");
$this->click("xpath=//div[@class='crm-search-results']/table/tbody//td/span/a[text()='View']");
$this->verifyText($xpath, preg_quote("Student"));
$this->openCiviPage('contact/search', 'reset=1', '_qf_Basic_refresh');
- $this->type('sort_name', $firstName3);
+ $this->type('sort_name', $firstName3);
$this->click('_qf_Basic_refresh');
$this->waitForElementPresent("xpath=//div[@class='crm-search-results']/table/tbody//td/span/a[text()='View']");
$this->click("xpath=//div[@class='crm-search-results']/table/tbody//td/span/a[text()='View']");
// Add new individual using Quick Add block on the main page
$firstName1 = "John_" . substr(sha1(rand()), 0, 7);
- $lastName = "Smith_" . substr(sha1(rand()), 0, 7);
- $Name1 = $lastName . ', ' . $firstName1;
+ $lastName = "Smith_" . substr(sha1(rand()), 0, 7);
+ $Name1 = $lastName . ', ' . $firstName1;
$this->webtestAddContact($firstName1, $lastName, "$firstName1.$lastName@example.com");
$this->waitForPageToLoad($this->getTimeoutMsec());
$Name2 = $lastName . ', ' . $firstName1;
$this->webtestAddContact($firstName1, $lastName, "$firstName1.$lastName@example.com");
$this->waitForPageToLoad($this->getTimeoutMsec());
- $profileTitle = 'Batch Profile test for contacts ' . substr(sha1(rand()), 0, 7);
- $profileFor = 'Contacts';
+ $profileTitle = 'Batch Profile test for contacts ' . substr(sha1(rand()), 0, 7);
+ $profileFor = 'Contacts';
$customDataArr = $this->_addCustomData($profileFor);
$this->_addProfile($profileTitle, $customDataArr, $profileFor);
) {
$assertCheck = TRUE;
}
- else $assertCheck = FALSE;
+ else {
+ $assertCheck = FALSE;
+ }
$this->assertTrue($assertCheck, 'copy rows for field one failed');
) {
$assertCheck = TRUE;
}
- else $assertCheck = FALSE;
+ else {
+ $assertCheck = FALSE;
+ }
$this->assertTrue($assertCheck, 'copy rows for field two failed');
if ($this->getValue("{$dateElementIdFirstRow}_time") == $this->getValue("{$dateElementIdSecondRow}_time") && $this->getValue("{$dateElementIdFirstRow}_display") == $this->getValue("{$dateElementIdSecondRow}_display")) {
$assertCheck = TRUE;
}
- else $assertCheck = FALSE;
+ else {
+ $assertCheck = FALSE;
+ }
$this->assertTrue($assertCheck, 'date / time coping failed');
if ($this->getValue($richTextAreaIdOne) == $this->getValue($richTextAreaIdTwo)) {
$assertCheck = TRUE;
}
- else $assertCheck = FALSE;
+ else {
+ $assertCheck = FALSE;
+ }
$this->assertTrue($assertCheck, 'Rich Text Area coping failed');
) {
$assertCheck = TRUE;
}
- else $assertCheck = FALSE;
+ else {
+ $assertCheck = FALSE;
+ }
$this->assertTrue($assertCheck, 'copy rows for field one failed[radio button]');
) {
$assertCheck = TRUE;
}
- else $assertCheck = FALSE;
+ else {
+ $assertCheck = FALSE;
+ }
$this->assertTrue($assertCheck, 'copy rows for field two failed[radio button]');
if ($this->getValue($richTextAreaIdOne) == $this->getValue($richTextAreaIdTwo)) {
$assertCheck = TRUE;
}
- else $assertCheck = FALSE;
+ else {
+ $assertCheck = FALSE;
+ }
$this->assertTrue($assertCheck, 'Rich Text Area coping failed [TinyMCE]');
$this->click('_qf_Results_upload_done-bottom');
$this->waitForPageToLoad($this->getTimeoutMsec());
- //Reserve and interview responsedents
+ //Reserve and interview respondents
$this->openCiviPage('campaign', 'reset=1&subPage=survey');
$this->waitForElementPresent("xpath=//table[@id='surveys']/tbody//tr/td[2]/a[text()='{$surveyTitle}']/../following-sibling::td[@class='crm-campaign-voterLinks']/span/ul/li/a");
$this->click("xpath=//table[@id='surveys']/tbody//tr/td[2]/a[text()='{$surveyTitle}']/../following-sibling::td[@class='crm-campaign-voterLinks']/span/ul/li/a");
$this->type('sort_name', $lastName);
$this->waitForElementPresent('_qf_Search_refresh');
$this->clickLink('_qf_Search_refresh', 'Go');
- $this->click('CIVICRM_QFID_ts_all_4');
+ $this->click('toggleSelect');
$this->click('Go');
$this->waitForElementPresent('_qf_Reserve_next_reserveToInterview-top');
- $this->click('_qf_Reserve_next_reserveToInterview-top');
- $this->waitForElementPresent('_qf_Interview_cancel_interview');
+ $this->clickLink('_qf_Reserve_next_reserveToInterview-top', '_qf_Interview_cancel_interview');
$this->isElementPresent("xpath=//table[@id='voterRecords']/tbody//tr/td[text()='{$Name2}']");
$this->isElementPresent("xpath=//table[@id='voterRecords']/tbody//tr/td[text()='{$Name1}']");
) {
$assertCheck = TRUE;
}
- else $assertCheck = FALSE;
+ else {
+ $assertCheck = FALSE;
+ }
$this->assertTrue($assertCheck, 'copy rows for field one failed for inteview (campaign)');
) {
$assertCheck = TRUE;
}
- else $assertCheck = FALSE;
+ else {
+ $assertCheck = FALSE;
+ }
$this->assertTrue($assertCheck, 'copy rows for field two failed for inteview (campaign)');
if ($this->getValue("{$dateElementIdFirstRow}_time") == $this->getValue("{$dateElementIdSecondRow}_time") && $this->getValue("{$dateElementIdFirstRow}_display") == $this->getValue("{$dateElementIdSecondRow}_display")) {
$assertCheck = TRUE;
}
- else $assertCheck = FALSE;
+ else {
+ $assertCheck = FALSE;
+ }
$this->assertTrue($assertCheck, 'date / time coping failed for inteview (campaign)');
if ($this->getValue("xpath=//table[@id='voterRecords']/tbody/tr/td[@class='note']/input") == $this->getValue("xpath=//table[@id='voterRecords']/tbody/tr[2]/td[@class='note']/input")) {
$assertCheck = TRUE;
}
- else $assertCheck = FALSE;
+ else {
+ $assertCheck = FALSE;
+ }
$this->assertTrue($assertCheck, 'Note Custom field coping failed');
) {
$assertCheck = TRUE;
}
- else $assertCheck = FALSE;
+ else {
+ $assertCheck = FALSE;
+ }
$this->assertTrue($assertCheck, 'copy rows for field one failed for inteview (campaign)[radio button]');
) {
$assertCheck = TRUE;
}
- else $assertCheck = FALSE;
+ else {
+ $assertCheck = FALSE;
+ }
$this->assertTrue($assertCheck, 'copy rows for field two failed for inteview (campaign)[radio button]');