3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License along with this program; if not, contact CiviCRM LLC |
21 | at info[AT]civicrm[DOT]org. If you have questions about the |
22 | GNU Affero General Public License or the licensing of CiviCRM, |
23 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
24 +--------------------------------------------------------------------+
27 require_once 'CiviTest/CiviSeleniumTestCase.php';
30 * Class WebTest_Mailing_ABMailingTest
32 class WebTest_Mailing_ABMailingTest
extends CiviSeleniumTestCase
{
34 protected function setUp() {
38 public function testWithDifferentSubject() {
39 $this->markTestSkipped('Skipping for now as it works fine locally.');
40 $this->webtestLogin();
42 //----do create test mailing group
43 $this->openCiviPage("group/add", "reset=1", "_qf_Edit_upload");
46 $groupName = 'group_' . substr(sha1(rand()), 0, 7);
49 $this->type("title", $groupName);
52 $this->type("description", "New mailing group for Webtest");
54 // enable Mailing List
55 $this->click("group_type[2]");
57 // select Visibility as Public Pages
58 $this->select("visibility", "value=Public Pages");
61 $this->clickLink("_qf_Edit_upload");
63 // Is status message correct?
64 $this->waitForText('crm-notification-container', "The Group '$groupName' has been saved.");
66 // no. of user to add into group
69 //---- create mailing contact and add to mailing Group
70 for ($i = 1; $i <= $totalUser; $i++
) {
71 $firstName = substr(sha1(rand()), 0, 7);
72 $this->webtestAddContact($firstName, "Mailson", "mailino$firstName@mailson.co.in");
74 // Get contact id from url.
75 $contactId = $this->urlArg('cid');
77 // go to group tab and add to mailing group
78 $this->click("css=li#tab_group a");
79 $this->waitForElementPresent("_qf_GroupContact_next");
80 $this->select("group_id", "$groupName");
81 $this->clickLink("_qf_GroupContact_next", "_qf_GroupContact_next", FALSE);
83 // configure default mail-box
84 $this->setupDefaultMailbox();
86 $this->openCiviPage("a/#/abtest/new", NULL, "xpath=//div[@class='crm-wizard-buttons']");
87 $this->waitForElementPresent("xpath=//input[@name='abName']");
89 $ABTestName = substr(sha1(rand()), 0, 7) . "ABTestName";
90 $this->type("xpath=//input[@name='abName']", "$ABTestName");
92 $this->click("xpath=//input[@value='subject']");
95 $this->click("//button[@ng-click='crmUiWizardCtrl.next()']");
97 // Add the test mailing group
98 $this->select2("s2id_crmUiId_13", $groupName, TRUE);
100 //$this->fireEvent('xpath=//div[@class="ui-slider-range"]', 'drag');
103 $this->click("//button[@ng-click='crmUiWizardCtrl.next()']");
104 $this->waitForElementPresent("xpath=//input[@name='subjectA']");
106 //-------Compose Mail----------
107 $tokens = ' {domain.address}{action.optOutUrl}';
109 // fill subject for mailing
110 $MailingSubject = substr(sha1(rand()), 0, 7);
111 $this->type("xpath=//input[@name='subjectA']", "Test subject {$MailingSubject} for A");
112 $this->type("xpath=//input[@name='subjectB']", "Test subject {$MailingSubject} for B");
114 // HTML format message
115 $HTMLMessage = "This is HTML formatted content for Mailing {$MailingSubject} Webtest.";
116 $this->fillRichTextField("crmUiId_1", $HTMLMessage . $tokens);
118 // FIXME: Selenium can't access content in an iframe
119 //$this->click("xpath=//div[@class='preview-popup']//a[text()='Preview as HTML']");
120 //$this->waitForTextPresent($HTMLMessage);
121 //$this->waitForAjaxContent();
122 //$this->click("xpath=//button[@title='Close']");
124 // Open Plain-text Format pane and type text format msg
125 $this->click("//div[starts-with(text(),'Plain Text')]");
126 $this->type("xpath=//*[@name='body_text']", "This is text formatted content for Mailing {$MailingSubject} Webtest.$tokens");
128 $this->click("xpath=//div[@class='preview-popup']//a[text()='Preview as Plain Text']");
129 $this->waitForTextPresent("This is text formatted content for Mailing {$MailingSubject} Webtest.");
130 $this->waitForAjaxContent();
131 $this->click("xpath=//button[@title='Close']");
133 // click next with default settings
134 $this->click("xpath=//div[@class='crm-wizard-buttons']/button[text()='Next']");
136 // click next with nominal content
137 $this->click("xpath=//center/a/div[text()='Submit Mailing']");
139 $this->waitForElementPresent("xpath=//button[text()='Select as Final']");
140 $this->click("xpath=//button[text()='Select as Final']");
141 $this->waitForElementPresent("xpath=//div[@class='ui-dialog-buttonset']/button/span[text()='Submit final mailing']");
142 $this->click("xpath=//div[@class='ui-dialog-buttonset']/button/span[text()='Submit final mailing']");
144 //----------end New Mailing-------------
146 $this->waitForAjaxContent();
148 //check redirected page to Scheduled and Sent Mailings and verify for mailing name
149 $this->openCiviPage("mailing/browse/scheduled", "reset=1&scheduled=true");
150 $this->waitForTextPresent("Find Mailings");
152 //--------- mail delivery verification---------
154 // click report link of created mailing
155 $this->clickLink("xpath=//form[@id='Search']/table/tbody//tr/td[@class='crm-mailing-name'][text()='Final ($ABTestName)']/..//td/span/a[text()='Report']");
157 // directly send schedule mailing -- not working right now
158 $this->openCiviPage("mailing/queue", "reset=1");
160 //click report link of created mailing
161 $this->clickLink("xpath=//form[@id='Search']/table/tbody//tr/td[@class='crm-mailing-name'][text()='Final ($ABTestName)']/..//td/span/a[text()='Report']");
163 //get actual number of user for mailing
164 $mailedUser = round($totalUser * ($totalUser / 100));
166 //---- check for delivery detail--
168 $this->waitForElementPresent("xpath=//table[@class='crm-mailing-ab-table']/tbody/tr//td//a[text()=" . $mailedUser . "]");
169 $this->assertElementContainsText("xpath=//table[@class='crm-mailing-ab-table']/tbody/tr//td//a[2]", "$mailedUser");
170 $this->assertElementContainsText("xpath=//table[@class='crm-mailing-ab-table']//tbody//tr//td/span", 'Complete');
172 //check value for Mailing A
173 $this->assertElementContainsText("xpath=//table[@class='crm-mailing-ab-table']/tbody[3]//tr/td[2]", 'Test A (' . $ABTestName . ')');
174 $this->assertElementContainsText("xpath=//table[@class='crm-mailing-ab-table']/tbody[3]/tr[3]//td[2]", 'Test subject ' . $MailingSubject . ' for A');
175 $this->assertElementContainsText("xpath=//table[@class='crm-mailing-ab-table']//tbody//tr[@ng-controller='ViewRecipCtrl']//td/div", "Include: " . $groupName);
177 ////check value for Mailing B
178 $this->assertElementContainsText("xpath=//table[@class='crm-mailing-ab-table']/tbody[3]//tr//td[3]", 'Test B (' . $ABTestName . ')');
179 $this->assertElementContainsText("xpath=//table[@class='crm-mailing-ab-table']/tbody[3]/tr[3]//td[3]", 'Test subject ' . $MailingSubject . ' for B');
181 //check value for Mailing Final
182 $this->assertElementContainsText("xpath=//table[@class='crm-mailing-ab-table']/tbody[3]//tr//td[4]", 'Final (' . $ABTestName . ')');
183 $this->assertElementContainsText("xpath=//table[@class='crm-mailing-ab-table']/tbody[3]/tr[3]//td[4]", 'Test subject ' . $MailingSubject . ' for A');
184 $this->assertElementContainsText("xpath=//table[@class='crm-mailing-ab-table']//tbody//tr[@ng-controller='ViewRecipCtrl']//td/div", "Include: " . $groupName);
187 public function testWithDifferentFrom() {
188 $this->markTestSkipped('Skipping for now as it works fine locally.');
189 $this->webtestLogin();
191 //----do create test mailing group
192 $this->openCiviPage("group/add", "reset=1", "_qf_Edit_upload");
195 $groupName = 'group_' . substr(sha1(rand()), 0, 7);
198 $this->type("title", $groupName);
201 $this->type("description", "New mailing group for Webtest");
203 // enable Mailing List
204 $this->click("group_type[2]");
206 // select Visibility as Public Pages
207 $this->select("visibility", "value=Public Pages");
210 $this->clickLink("_qf_Edit_upload");
212 // Is status message correct?
213 $this->waitForText('crm-notification-container', "The Group '$groupName' has been saved.");
215 // no. of user to add into group
218 //---- create mailing contact and add to mailing Group
219 for ($i = 1; $i <= $totalUser; $i++
) {
220 $firstName = substr(sha1(rand()), 0, 7);
221 $this->webtestAddContact($firstName, "Mailson", "mailino$firstName@mailson.co.in");
223 // Get contact id from url.
224 $contactId = $this->urlArg('cid');
226 // go to group tab and add to mailing group
227 $this->click("css=li#tab_group a");
228 $this->waitForElementPresent("_qf_GroupContact_next");
229 $this->select("group_id", "$groupName");
230 $this->clickLink("_qf_GroupContact_next", "_qf_GroupContact_next", FALSE);
232 // configure default mail-box
233 $this->setupDefaultMailbox();
235 // configure new Form
236 $this->openCiviPage("admin/options/from_email_address", "reset=1");
237 $this->waitForElementPresent("xpath=//div[@class='action-link']/a/span[contains(text(), 'Add From Email Address')]");
238 $this->click("xpath=//div[@class='action-link']/a/span[contains(text(), 'Add From Email Address')]");
239 $this->waitForAjaxContent();
241 // make Form Email address
242 $formEmailAddressA = 'ABMailing_' . substr(sha1(rand()), 0, 7);
243 $aEmailID = '"' . $formEmailAddressA . '" <' . $formEmailAddressA . '@abtest.org>';
244 $this->type("xpath=//input[@name='label']", "$aEmailID");
245 $this->click("xpath=//button/span[text()='Save']");
247 // make Form Email address
248 $this->click("xpath=//div[@class='action-link']/a/span[contains(text(), 'Add From Email Address')]");
249 $this->waitForAjaxContent();
250 $formEmailAddressB = 'ABMailing_' . substr(sha1(rand()), 0, 7);
251 $bEmailID = '"' . $formEmailAddressB . '" <' . $formEmailAddressB . '@abtest.org>';
252 $this->type("xpath=//input[@name='label']", "$bEmailID");
253 $this->click("xpath=//button/span[text()='Save']");
255 $this->openCiviPage("a/#/abtest/new", NULL, "xpath=//div[@class='crm-wizard-buttons']");
256 $this->waitForElementPresent("xpath=//input[@name='abName']");
258 $ABTestName = substr(sha1(rand()), 0, 7) . "ABTestName";
259 $this->type("xpath=//input[@name='abName']", "$ABTestName");
261 $this->click("xpath=//input[@value='from']");
264 $this->click("//button[@ng-click='crmUiWizardCtrl.next()']");
266 // Add the test mailing group
267 $this->select2("s2id_crmUiId_13", $groupName, TRUE);
270 $this->click("//button[@ng-click='crmUiWizardCtrl.next()']");
271 $this->waitForElementPresent("xpath=//input[@name='subject']");
273 //-------Compose Mail----------
274 $tokens = ' {domain.address}{action.optOutUrl}';
276 // fill subject for mailing
277 $MailingSubject = substr(sha1(rand()), 0, 7);
278 $this->type("xpath=//input[@name='subject']", "Test subject {$MailingSubject} for webtest");
279 $this->waitForElementPresent("xpath=//div[@id='s2id_crmUiId_20']");
281 // choose form email address for A
282 $this->select("crmUiId_20", "value=$aEmailID");
284 // choose form email address for B
285 $this->select("crmUiId_21", "value=$bEmailID");
287 // HTML format message
288 $HTMLMessage = "This is HTML formatted content for Mailing {$MailingSubject} Webtest.";
289 $this->fillRichTextField("crmUiId_1", $HTMLMessage . $tokens);
291 // FIXME: Selenium can't access content in an iframe
292 //$this->click("xpath=//div[@class='preview-popup']//a[text()='Preview as HTML']");
293 //$this->waitForTextPresent($HTMLMessage);
294 //$this->waitForAjaxContent();
295 //$this->click("xpath=//button[@title='Close']");
297 // Open Plain-text Format pane and type text format msg
298 $this->click("//div[starts-with(text(),'Plain Text')]");
299 $this->type("xpath=//*[@name='body_text']", "This is text formatted content for Mailing {$MailingSubject} Webtest.$tokens");
301 $this->click("xpath=//div[@class='preview-popup']//a[text()='Preview as Plain Text']");
302 $this->waitForTextPresent("This is text formatted content for Mailing {$MailingSubject} Webtest.");
303 $this->waitForAjaxContent();
304 $this->click("xpath=//button[@title='Close']");
306 // click next with default settings
307 $this->click("xpath=//div[@class='crm-wizard-buttons']/button[text()='Next']");
309 // click next with nominal content
310 $this->click("xpath=//center/a/div[text()='Submit Mailing']");
312 $this->waitForElementPresent("xpath=//button[text()='Select as Final']");
313 $this->click("xpath=//button[text()='Select as Final']");
314 $this->waitForElementPresent("xpath=//div[@class='ui-dialog-buttonset']/button/span[text()='Submit final mailing']");
315 $this->click("xpath=//div[@class='ui-dialog-buttonset']/button/span[text()='Submit final mailing']");
317 //----------end New Mailing-------------
319 $this->waitForAjaxContent();
321 //check redirected page to Scheduled and Sent Mailings and verify for mailing name
322 $this->openCiviPage("mailing/browse/scheduled", "reset=1&scheduled=true");
323 $this->waitForTextPresent("Find Mailings");
325 //--------- mail delivery verification---------
327 // click report link of created mailing
328 $this->clickLink("xpath=//form[@id='Search']/table/tbody//tr/td[@class='crm-mailing-name'][text()='Final ($ABTestName)']/..//td/span/a[text()='Report']");
330 // directly send schedule mailing -- not working right now
331 $this->openCiviPage("mailing/queue", "reset=1");
333 //click report link of created mailing
334 $this->clickLink("xpath=//form[@id='Search']/table/tbody//tr/td[@class='crm-mailing-name'][text()='Final ($ABTestName)']/..//td/span/a[text()='Report']");
336 //get actual number of user for mailing
337 $mailedUser = round($totalUser * ($totalUser / 100));
339 //---- check for delivery detail--
340 $this->waitForElementPresent("xpath=//table[@class='crm-mailing-ab-table']/tbody/tr//td//a[text()=" . $mailedUser . "]");
341 $this->assertElementContainsText("xpath=//table[@class='crm-mailing-ab-table']/tbody/tr//td//a[2]", "$mailedUser");
342 $this->assertElementContainsText("xpath=//table[@class='crm-mailing-ab-table']//tbody//tr//td/span", 'Complete');
344 //check value for Mailing A
345 $this->assertElementContainsText("xpath=//table[@class='crm-mailing-ab-table']/tbody[3]//tr/td[2]", 'Test A (' . $ABTestName . ')');
346 $this->assertElementContainsText("xpath=//table[@class='crm-mailing-ab-table']/tbody[3]/tr[2]/td[2]", "$aEmailID");
347 $this->assertElementContainsText("xpath=//table[@class='crm-mailing-ab-table']/tbody[3]/tr[3]//td[2]", 'Test subject ' . $MailingSubject . ' for webtest');
348 $this->assertElementContainsText("xpath=//table[@class='crm-mailing-ab-table']//tbody//tr[@ng-controller='ViewRecipCtrl']//td/div", "Include: " . $groupName);
350 //check value for Mailing B
351 $this->assertElementContainsText("xpath=//table[@class='crm-mailing-ab-table']/tbody[3]//tr//td[3]", 'Test B (' . $ABTestName . ')');
352 $this->assertElementContainsText("xpath=//table[@class='crm-mailing-ab-table']/tbody[3]/tr[2]/td[3]", "$bEmailID");
353 $this->assertElementContainsText("xpath=//table[@class='crm-mailing-ab-table']/tbody[3]/tr[3]//td[3]", 'Test subject ' . $MailingSubject . ' for webtest');
355 //check value for Mailing Final
356 $this->assertElementContainsText("xpath=//table[@class='crm-mailing-ab-table']/tbody[3]//tr//td[4]", 'Final (' . $ABTestName . ')');
357 $this->assertElementContainsText("xpath=//table[@class='crm-mailing-ab-table']/tbody[3]/tr[2]/td[4]", "$aEmailID");
358 $this->assertElementContainsText("xpath=//table[@class='crm-mailing-ab-table']/tbody[3]/tr[3]//td[4]", 'Test subject ' . $MailingSubject . ' for webtest');
359 $this->assertElementContainsText("xpath=//table[@class='crm-mailing-ab-table']//tbody//tr[@ng-controller='ViewRecipCtrl']//td/div", "Include: " . $groupName);
362 public function testWithDifferentABMailing() {
363 $this->markTestSkipped('Skipping for now as it works fine locally.');
364 $this->webtestLogin();
366 //----do create test mailing group
367 $this->openCiviPage("group/add", "reset=1", "_qf_Edit_upload");
370 $groupName = 'group_' . substr(sha1(rand()), 0, 7);
373 $this->type("title", $groupName);
376 $this->type("description", "New mailing group for Webtest");
378 // enable Mailing List
379 $this->click("group_type[2]");
381 // select Visibility as Public Pages
382 $this->select("visibility", "value=Public Pages");
385 $this->clickLink("_qf_Edit_upload");
387 // Is status message correct?
388 $this->waitForText('crm-notification-container', "The Group '$groupName' has been saved.");
390 // no. of user to add into group
393 //---- create mailing contact and add to mailing Group
394 for ($i = 1; $i <= $totalUser; $i++
) {
395 $firstName = substr(sha1(rand()), 0, 7);
396 $this->webtestAddContact($firstName, "Mailson", "mailino$firstName@mailson.co.in");
398 // Get contact id from url.
399 $contactId = $this->urlArg('cid');
401 // go to group tab and add to mailing group
402 $this->click("css=li#tab_group a");
403 $this->waitForElementPresent("_qf_GroupContact_next");
404 $this->select("group_id", "$groupName");
405 $this->clickLink("_qf_GroupContact_next", "_qf_GroupContact_next", FALSE);
407 // configure default mail-box
408 $this->setupDefaultMailbox();
410 $this->openCiviPage("a/#/abtest/new", NULL, "xpath=//div[@class='crm-wizard-buttons']");
411 $this->waitForElementPresent("xpath=//input[@name='abName']");
413 $ABTestName = substr(sha1(rand()), 0, 7) . "ABTestName";
414 $this->type("xpath=//input[@name='abName']", "$ABTestName");
416 $this->click("xpath=//input[@value='full_email']");
419 $this->click("//button[@ng-click='crmUiWizardCtrl.next()']");
421 // Add the test mailing group
422 $this->select2("s2id_crmUiId_13", $groupName, TRUE);
425 $this->click("//button[@ng-click='crmUiWizardCtrl.next()']");
426 $this->waitForElementPresent("xpath=//input[@name='subjectA']");
428 //-------Compose A----------
429 $tokens = ' {domain.address}{action.optOutUrl}';
431 // fill subject for mailing
432 $AMailingSubject = substr(sha1(rand()), 0, 7);
433 $this->type("xpath=//input[@name='subjectA']", "Test subject {$AMailingSubject} for Webtest");
435 // HTML format message
436 $AHTMLMessage = "This is HTML formatted content for Mailing {$AMailingSubject} Webtest.";
437 $this->fillRichTextField("crmUiId_19", $AHTMLMessage . $tokens);
439 // FIXME: Selenium can't access content in an iframe
440 //$this->click("xpath=//div[@class='preview-popup']//a[text()='Preview as HTML']");
441 //$this->waitForTextPresent($AHTMLMessage);
442 //$this->waitForAjaxContent();
443 //$this->click("xpath=//button[@title='Close']");
445 // Open Plain-text Format pane and type text format msg
446 $this->click("//div[starts-with(text(),'Plain Text')]");
447 $this->type("xpath=//*[@name='body_text']", "This is text formatted content for Mailing {$AMailingSubject} Webtest.$tokens");
449 $this->click("xpath=//div[@class='preview-popup']//a[text()='Preview as Plain Text']");
450 $this->waitForTextPresent("This is text formatted content for Mailing {$AMailingSubject} Webtest.");
451 $this->waitForAjaxContent();
452 $this->click("xpath=//button[@title='Close']");
454 // click next with default settings
455 $this->click("xpath=//div[@class='crm-wizard-buttons']/button[text()='Next']");
456 $this->waitForElementPresent("xpath=//input[@name='subjectB']");
458 //-------Compose B----------
460 // fill subject for mailing
461 $BMailingSubject = substr(sha1(rand()), 0, 7);
462 $this->type("xpath=//input[@name='subjectB']", "Test subject {$BMailingSubject} for Webtest");
464 // HTML format message
465 $BHTMLMessage = "This is HTML formatted content for Mailing {$BMailingSubject} Webtest.";
466 $this->fillRichTextField("crmUiId_28", $BHTMLMessage . $tokens);
468 // FIXME: Selenium can't access content in an iframe
469 //$this->click("xpath=//div[@class='preview-popup']//a[text()='Preview as HTML']");
470 //$this->waitForTextPresent($BHTMLMessage);
471 //$this->waitForAjaxContent();
472 //$this->click("xpath=//button[@title='Close']");
474 // Open Plain-text Format pane and type text format msg
475 $this->waitForElementPresent("xpath=//div[@id='tab-mailingB']//div[contains(text(), 'Plain Text')]");
476 $this->click("xpath=//div[@id='tab-mailingB']//div[contains(text(), 'Plain Text')]");
477 $this->type("xpath=//div[@id='tab-mailingB']//*[@name='body_text']", "This is text formatted content for Mailing {$BMailingSubject} Webtest.$tokens");
479 $this->click("xpath=//div[@crm-mailing='abtest.mailings.b']//div[@class='preview-popup']//a[text()='Preview as Plain Text']");
480 $this->waitForTextPresent("This is text formatted content for Mailing {$BMailingSubject} Webtest.");
481 $this->waitForAjaxContent();
482 $this->click("xpath=//button[@title='Close']");
484 // click next with default settings
485 $this->click("xpath=//div[@class='crm-wizard-buttons']/button[text()='Next']");
487 // click next with nominal content
488 $this->click("xpath=//center/a/div[text()='Submit Mailing']");
490 $this->waitForElementPresent("xpath=//button[text()='Select as Final']");
491 $this->click("xpath=//button[text()='Select as Final']");
492 $this->waitForElementPresent("xpath=//div[@class='ui-dialog-buttonset']/button/span[text()='Submit final mailing']");
493 $this->click("xpath=//div[@class='ui-dialog-buttonset']/button/span[text()='Submit final mailing']");
495 //----------end New Mailing-------------
497 $this->waitForAjaxContent();
499 //check redirected page to Scheduled and Sent Mailings and verify for mailing name
500 $this->openCiviPage("mailing/browse/scheduled", "reset=1&scheduled=true");
501 $this->waitForTextPresent("Find Mailings");
503 //--------- mail delivery verification---------
505 // click report link of created mailing
506 $this->clickLink("xpath=//form[@id='Search']/table/tbody//tr/td[@class='crm-mailing-name'][text()='Final ($ABTestName)']/..//td/span/a[text()='Report']");
508 // directly send schedule mailing -- not working right now
509 $this->openCiviPage("mailing/queue", "reset=1");
511 //click report link of created mailing
512 $this->clickLink("xpath=//form[@id='Search']/table/tbody//tr/td[@class='crm-mailing-name'][text()='Final ($ABTestName)']/..//td/span/a[text()='Report']");
514 //get actual number of user for mailing
515 $mailedUser = round($totalUser * ($totalUser / 100));
517 //---- check for delivery detail--
518 $this->waitForElementPresent("xpath=//table[@class='crm-mailing-ab-table']/tbody/tr//td//a[text()=" . $mailedUser . "]");
519 $this->assertElementContainsText("xpath=//table[@class='crm-mailing-ab-table']/tbody/tr//td//a[2]", "$mailedUser");
520 $this->assertElementContainsText("xpath=//table[@class='crm-mailing-ab-table']//tbody//tr//td/span", 'Complete');
522 //check value for Mailing A
523 $this->assertElementContainsText("xpath=//table[@class='crm-mailing-ab-table']/tbody[3]//tr/td[2]", 'Test A (' . $ABTestName . ')');
524 $this->assertElementContainsText("xpath=//table[@class='crm-mailing-ab-table']/tbody[3]/tr[3]//td[2]", 'Test subject ' . $AMailingSubject . ' for Webtest');
525 $this->assertElementContainsText("xpath=//table[@class='crm-mailing-ab-table']//tbody//tr[@ng-controller='ViewRecipCtrl']//td/div", "Include: " . $groupName);
527 //check value for Mailing B
528 $this->assertElementContainsText("xpath=//table[@class='crm-mailing-ab-table']/tbody[3]//tr//td[3]", 'Test B (' . $ABTestName . ')');
529 $this->assertElementContainsText("xpath=//table[@class='crm-mailing-ab-table']/tbody[3]/tr[3]//td[3]", 'Test subject ' . $BMailingSubject . ' for Webtest');
531 //check value for Mailing Final
532 $this->assertElementContainsText("xpath=//table[@class='crm-mailing-ab-table']/tbody[3]//tr//td[4]", 'Final (' . $ABTestName . ')');
533 $this->assertElementContainsText("xpath=//table[@class='crm-mailing-ab-table']/tbody[3]/tr[3]//td[4]", 'Test subject ' . $AMailingSubject . ' for Webtest');
534 $this->assertElementContainsText("xpath=//table[@class='crm-mailing-ab-table']//tbody//tr[@ng-controller='ViewRecipCtrl']//td/div", "Include: " . $groupName);