X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=tests%2Fphpunit%2FWebTest%2FProfile%2FBatchUpdateTest.php;h=d2461ba7c4b6bfd1f4dd6cc0b503b9f30ac7ff87;hb=a25af9cedc4796a32b1d55d1b2b10e4241f18e6e;hp=9f61937d820561050d5400aa9e364a5b9fa9188a;hpb=6e46589da472f166ecc1b3c5f9182e3d9f3dbadd;p=civicrm-core.git diff --git a/tests/phpunit/WebTest/Profile/BatchUpdateTest.php b/tests/phpunit/WebTest/Profile/BatchUpdateTest.php index 9f61937d82..d2461ba7c4 100644 --- a/tests/phpunit/WebTest/Profile/BatchUpdateTest.php +++ b/tests/phpunit/WebTest/Profile/BatchUpdateTest.php @@ -27,10 +27,6 @@ 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(); } @@ -41,18 +37,18 @@ class WebTest_Profile_BatchUpdateTest extends CiviSeleniumTestCase { // 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"); @@ -60,7 +56,7 @@ class WebTest_Profile_BatchUpdateTest extends CiviSeleniumTestCase { $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', @@ -107,7 +103,7 @@ class WebTest_Profile_BatchUpdateTest extends CiviSeleniumTestCase { // 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']"); @@ -117,7 +113,7 @@ class WebTest_Profile_BatchUpdateTest extends CiviSeleniumTestCase { $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']"); @@ -133,8 +129,8 @@ class WebTest_Profile_BatchUpdateTest extends CiviSeleniumTestCase { // 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()); @@ -143,8 +139,8 @@ class WebTest_Profile_BatchUpdateTest extends CiviSeleniumTestCase { $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); @@ -203,7 +199,9 @@ class WebTest_Profile_BatchUpdateTest extends CiviSeleniumTestCase { ) { $assertCheck = TRUE; } - else $assertCheck = FALSE; + else { + $assertCheck = FALSE; + } $this->assertTrue($assertCheck, 'copy rows for field one failed'); @@ -226,7 +224,9 @@ class WebTest_Profile_BatchUpdateTest extends CiviSeleniumTestCase { ) { $assertCheck = TRUE; } - else $assertCheck = FALSE; + else { + $assertCheck = FALSE; + } $this->assertTrue($assertCheck, 'copy rows for field two failed'); @@ -243,7 +243,9 @@ class WebTest_Profile_BatchUpdateTest extends CiviSeleniumTestCase { 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'); @@ -260,7 +262,9 @@ class WebTest_Profile_BatchUpdateTest extends CiviSeleniumTestCase { if ($this->getValue($richTextAreaIdOne) == $this->getValue($richTextAreaIdTwo)) { $assertCheck = TRUE; } - else $assertCheck = FALSE; + else { + $assertCheck = FALSE; + } $this->assertTrue($assertCheck, 'Rich Text Area coping failed'); @@ -290,7 +294,9 @@ class WebTest_Profile_BatchUpdateTest extends CiviSeleniumTestCase { ) { $assertCheck = TRUE; } - else $assertCheck = FALSE; + else { + $assertCheck = FALSE; + } $this->assertTrue($assertCheck, 'copy rows for field one failed[radio button]'); @@ -313,7 +319,9 @@ class WebTest_Profile_BatchUpdateTest extends CiviSeleniumTestCase { ) { $assertCheck = TRUE; } - else $assertCheck = FALSE; + else { + $assertCheck = FALSE; + } $this->assertTrue($assertCheck, 'copy rows for field two failed[radio button]'); @@ -361,7 +369,9 @@ class WebTest_Profile_BatchUpdateTest extends CiviSeleniumTestCase { if ($this->getValue($richTextAreaIdOne) == $this->getValue($richTextAreaIdTwo)) { $assertCheck = TRUE; } - else $assertCheck = FALSE; + else { + $assertCheck = FALSE; + } $this->assertTrue($assertCheck, 'Rich Text Area coping failed [TinyMCE]'); @@ -387,7 +397,7 @@ class WebTest_Profile_BatchUpdateTest extends CiviSeleniumTestCase { $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"); @@ -397,7 +407,7 @@ class WebTest_Profile_BatchUpdateTest extends CiviSeleniumTestCase { $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->clickLink('_qf_Reserve_next_reserveToInterview-top', '_qf_Interview_cancel_interview'); @@ -432,7 +442,9 @@ class WebTest_Profile_BatchUpdateTest extends CiviSeleniumTestCase { ) { $assertCheck = TRUE; } - else $assertCheck = FALSE; + else { + $assertCheck = FALSE; + } $this->assertTrue($assertCheck, 'copy rows for field one failed for inteview (campaign)'); @@ -455,7 +467,9 @@ class WebTest_Profile_BatchUpdateTest extends CiviSeleniumTestCase { ) { $assertCheck = TRUE; } - else $assertCheck = FALSE; + else { + $assertCheck = FALSE; + } $this->assertTrue($assertCheck, 'copy rows for field two failed for inteview (campaign)'); @@ -472,7 +486,9 @@ class WebTest_Profile_BatchUpdateTest extends CiviSeleniumTestCase { 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)'); @@ -486,7 +502,9 @@ class WebTest_Profile_BatchUpdateTest extends CiviSeleniumTestCase { 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'); @@ -515,7 +533,9 @@ class WebTest_Profile_BatchUpdateTest extends CiviSeleniumTestCase { ) { $assertCheck = TRUE; } - else $assertCheck = FALSE; + else { + $assertCheck = FALSE; + } $this->assertTrue($assertCheck, 'copy rows for field one failed for inteview (campaign)[radio button]'); @@ -538,7 +558,9 @@ class WebTest_Profile_BatchUpdateTest extends CiviSeleniumTestCase { ) { $assertCheck = TRUE; } - else $assertCheck = FALSE; + else { + $assertCheck = FALSE; + } $this->assertTrue($assertCheck, 'copy rows for field two failed for inteview (campaign)[radio button]');