$this->waitForPageToLoad($this->getTimeoutMsec());
// Is status message correct
- $this->assertTrue($this->isTextPresent("The Message Template '$msgTitle' has been saved."));
+ $this->assertElementContainsText('crm-notification-container', "The Message Template '$msgTitle' has been saved.");
// Verify text.
- $this->assertTrue($this->isTextPresent($msgTitle));
+ $this->assertTrue($this->isElementPresent("xpath=id('user')/div[2]/div/table/tbody//tr/td[1][contains(text(), '$msgTitle')]"),
+ 'Message Template Title not found!');
if (!$useTokens) {
- $this->assertTrue($this->isTextPresent($msgSubject));
+ $this->assertTrue($this->isElementPresent("xpath=id('user')/div[2]/div/table/tbody//tr/td[2][contains(text(), '$msgSubject')]"),
+ 'Message Subject not found!');
}
}
$this->assertChecked("open_tracking");
// do check count for Recipient
- $this->assertTrue($this->isTextPresent("Total Recipients: 1"));
+ $this->assertElementContainsText('css=.messages', "Total Recipients: 1");
$this->click("_qf_Settings_next");
$this->waitForElementPresent("_qf_Upload_cancel");
$this->select('footer_id', "label=Mailing Footer");
// do check count for Recipient
- $this->assertTrue($this->isTextPresent("Total Recipients: 1"));
+ $this->assertElementContainsText('css=.messages', "Total Recipients: 1");
// click next with nominal content
$this->click("_qf_Upload_upload");
$this->waitForElementPresent("_qf_Test_cancel");
- $this->assertTrue($this->isTextPresent("Total Recipients: 1"));
+ $this->assertElementContainsText('css=.messages', "Total Recipients: 1");
// click next
$this->click("_qf_Test_next");
$this->assertChecked("now");
// do check count for Recipient
- $this->assertTrue($this->isTextPresent("Total Recipients: 1"));
+ $this->assertElementContainsText('css=.messages', "Total Recipients: 1");
// finally schedule the mail by clicking submit
$this->click("_qf_Schedule_next");
$this->waitForPageToLoad($this->getTimeoutMsec());
//check redirected page to Scheduled and Sent Mailings and verify for mailing name
- $this->assertTrue($this->isTextPresent("Scheduled and Sent Mailings"));
- $this->assertTrue($this->isTextPresent("Mailing $mailingName Webtest"));
+ $this->assertElementContainsText('page-title', "Scheduled and Sent Mailings");
+ $this->assertElementContainsText("xpath=//table[@class='selector']/tbody//tr//td", "Mailing $mailingName Webtest");
$this->openCiviPage('mailing/queue', 'reset=1');
// verify status
$this->click("xpath=id('Search')/div[3]/div/div[2]/table/tbody/tr[2]/td[9]/span/a[text()='View']");
$this->waitForElementPresent("_qf_ActivityView_next");
- $this->assertTrue($this->isTextPresent("Bulk Email Sent."), "Status message didn't show up after saving!");
+ $this->assertElementContainsText('help', "Bulk Email Sent.", "Status message didn't show up after saving!");
}
-}
+}
\ No newline at end of file
$this->webtestLogin();
// Go directly to the URL of the screen that you will be testing (Add New Mailing Component).
- $this->open($this->sboxPath . "civicrm/admin/component?action=add&reset=1");
-
+ $this->openCiviPage("admin/component", "action=add&reset=1");
// fill component name.
$componentName = 'ComponentName_' . substr(sha1(rand()), 0, 7);
$this->waitForPageToLoad($this->getTimeoutMsec());
// Is status message correct.
- $this->assertTrue($this->isTextPresent("The mailing component '$componentName' has been saved."));
+ $this->assertElementContainsText('crm-notification-container', "The mailing component '$componentName' has been saved.");
// Verify text.
- $this->assertTrue($this->isTextPresent($componentName));
- $this->assertTrue($this->isTextPresent("Header"));
- $this->assertTrue($this->isTextPresent($subject));
- $this->assertTrue($this->isTextPresent($txtMsg));
- $this->assertTrue($this->isTextPresent($htmlMsg));
+ $this->assertTrue($this->isElementPresent("xpath=//table/tbody//tr/td[text()='{$componentName}']/../td[2][text()='Header']/../td[3][text()='{$subject}']/../td[4][text()='{$txtMsg}']/../td[5][text()='{$htmlMsg}']"), "The row doesn't consists of proper component details");
}
function testFooterAdd() {
// class attributes.
$this->open($this->sboxPath);
- // Logging in. Remember to wait for page to load. In most cases,
- // you can rely on 30000 as the value that allows your test to pass, however,
- // sometimes your test might fail because of this. In such cases, it's better to pick one element
- // somewhere at the end of page and use waitForElementPresent on it - this assures you, that whole
- // page contents loaded and you can continue your test execution.
$this->webtestLogin();
// Go directly to the URL of the screen that you will be testing (Add New Mailing Component).
- $this->open($this->sboxPath . "civicrm/admin/component?action=add&reset=1");
-
+ $this->openCiviPage("admin/component", "action=add&reset=1");
// fill component name.
$componentName = 'ComponentName_' . substr(sha1(rand()), 0, 7);
$this->waitForPageToLoad($this->getTimeoutMsec());
// Is status message correct.
- $this->assertTrue($this->isTextPresent("The mailing component '$componentName' has been saved."));
+ $this->assertElementContainsText('crm-notification-container', "The mailing component '$componentName' has been saved.");
// Verify text.
- $this->assertTrue($this->isTextPresent($componentName));
- $this->assertTrue($this->isTextPresent("Footer"));
- $this->assertTrue($this->isTextPresent($subject));
- $this->assertTrue($this->isTextPresent($txtMsg));
- $this->assertTrue($this->isTextPresent($htmlMsg));
+ $this->assertTrue($this->isElementPresent("xpath=//table/tbody//tr/td[text()='{$componentName}']/../td[2][text()='Footer']/../td[3][text()='{$subject}']/../td[4][text()='{$txtMsg}']/../td[5][text()='{$htmlMsg}']"), "The row doesn't consists of proper component details");
}
function testAutomatedAdd() {
// class attributes.
$this->open($this->sboxPath);
- // Logging in. Remember to wait for page to load. In most cases,
- // you can rely on 30000 as the value that allows your test to pass, however,
- // sometimes your test might fail because of this. In such cases, it's better to pick one element
- // somewhere at the end of page and use waitForElementPresent on it - this assures you, that whole
- // page contents loaded and you can continue your test execution.
$this->webtestLogin();
// Go directly to the URL of the screen that you will be testing (Add New Mailing Component).
- $this->open($this->sboxPath . "civicrm/admin/component?action=add&reset=1");
-
+ $this->openCiviPage("admin/component", "action=add&reset=1");
// fill component name.
$componentName = 'ComponentName_' . substr(sha1(rand()), 0, 7);
$this->waitForPageToLoad($this->getTimeoutMsec());
// Is status message correct.
- $this->assertTrue($this->isTextPresent("The mailing component '$componentName' has been saved."));
+ $this->assertElementContainsText('crm-notification-container', "The mailing component '$componentName' has been saved.");
// Verify text
- $this->assertTrue($this->isTextPresent($componentName));
- $this->assertTrue($this->isTextPresent("Reply"));
- $this->assertTrue($this->isTextPresent($subject));
- $this->assertTrue($this->isTextPresent($txtMsg));
- $this->assertTrue($this->isTextPresent($htmlMsg));
+ $this->assertTrue($this->isElementPresent("xpath=//table/tbody//tr/td[text()='{$componentName}']/../td[2][text()='Reply']/../td[3][text()='{$subject}']/../td[4][text()='{$txtMsg}']/../td[5][text()='{$htmlMsg}']"), "The row doesn't consists of proper component details");
}
-}
-
-
+}
\ No newline at end of file