From e29a115afbabdaa7ac4cd1ba9bfb79ce2e7e6945 Mon Sep 17 00:00:00 2001 From: Anjali Ujjainia Date: Sat, 28 May 2016 00:36:02 +0530 Subject: [PATCH] CRM_18560 Added test for empty body mailing component --- .../ValidateBodyMailingComponentTest.php | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 tests/phpunit/WebTest/Mailing/ValidateBodyMailingComponentTest.php 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 -- 2.25.1