From: Anjali Ujjainia Date: Fri, 27 May 2016 19:06:02 +0000 (+0530) Subject: CRM_18560 Added test for empty body mailing component X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=e29a115afbabdaa7ac4cd1ba9bfb79ce2e7e6945;p=civicrm-core.git CRM_18560 Added test for empty body mailing component --- diff --git a/tests/phpunit/WebTest/Mailing/ValidateBodyMailingComponentTest.php b/tests/phpunit/WebTest/Mailing/ValidateBodyMailingComponentTest.php new file mode 100644 index 0000000000..32d3592ab0 --- /dev/null +++ b/tests/phpunit/WebTest/Mailing/ValidateBodyMailingComponentTest.php @@ -0,0 +1,71 @@ +webtestLogin(); + + $this->openCiviPage("admin/component", "action=add&reset=1"); + + // fill component name. + $componentName = 'ComponentName_' . substr(sha1(rand()), 0, 7); + $this->type("name", $componentName); + + // fill component type + $this->click("component_type"); + $this->select("component_type", "value=Header"); + + // fill subject + $subject = "This is subject for New Mailing Component."; + $this->type("subject", $subject); + + // fill no text message + + // fill no html message + + $this->click("is_default"); + // Clicking save. + $this->click("_qf_Component_next"); + $this->waitForPageToLoad($this->getTimeoutMsec()); + + // Is status message correct. + $status = "Please provide either HTML or TEXT format for the Body."; + $this->waitForText('crm-notification-container', $status); + + // Verify the error text. + $this->assertTrue($this->isElementPresent("xpath=//table/tbody//tr/td[2]/span[text()='{$status}']"), "The row doesn't consists of proper component details"); + } +} \ No newline at end of file