Skip to content
Snippets Groups Projects
Commit 873f0f82 authored by lobo's avatar lobo
Browse files

Merge pull request #1681 from pratik-joshi/v43

webtest fixes
parents 8ed50e42 720bc24b
No related branches found
No related tags found
No related merge requests found
......@@ -241,7 +241,7 @@ class WebTest_Contribute_ContributionPageAddTest extends CiviSeleniumTestCase {
//View Contribution for separate contribution
$this->waitForElementPresent("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
// Open search criteria again
$this->click("xpath=id('Search')/x:div[2]/x:div/x:div[1]");
$this->click("xpath=id('Search')/div[2]/div/div[1]");
$this->waitForElementPresent("financial_type_id");
$this->select('financial_type_id',"label=Donation");
$this->clickLink('_qf_Search_refresh', "xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
......
......@@ -105,7 +105,7 @@ class WebTest_Contribute_OnlineContributionTest extends CiviSeleniumTestCase {
$this->select("state_province-1", "value=1001");
// Honoree Info
$this->click("xpath=id('Main')/x:div[2]/x:fieldset/x:div[2]/x:div/x:label[text()='In Honor of']");
$this->click("xpath=id('Main')/div[2]/fieldset/div[2]/div/label[text()='In Honor of']");
$this->waitForElementPresent("honor_email");
$this->select("honor_prefix_id", "label=Ms.");
......
......@@ -197,7 +197,7 @@ class WebTest_Contribute_PCPAddTest extends CiviSeleniumTestCase {
$this->verifyText("xpath=id('PCPView')//div[@class='crm-accordion-body']/table/tbody/tr[2]/td[2]/a[text()]", preg_quote("{$firstName} {$lastName}"));
// Check PCP Summary Report
$this->openCiviPage('report/instance/15', 'reset=1');
$this->openCiviPage('report/instance/16', 'reset=1');
$this->verifyText("PCP", preg_quote($pcpTitle));
$this->verifyText("PCP", preg_quote("{$lastName}, {$firstName}"));
}
......
......@@ -207,20 +207,20 @@ class WebTest_Profile_MultiRecordProfileAddTest extends CiviSeleniumTestCase {
$this->assertElementContainsText('crm-container', 'No multi-record entries found');
return array($gid, $profileTitle);
}
$this->waitForElementPresent("//div[@id='crm-profile-block']/a");
$this->click("//div[@id='crm-profile-block']/a");
$this->waitForElementPresent("//a/span[contains(text(), 'Add New Record')]");
$this->click("//a/span[contains(text(), 'Add New Record')]");
$record1 = $this->_addRecords();
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->verifyText("//div[@id='browseValues']/div/div/table/thead/tr/th[1]", preg_quote($params['textFieldLabel']));
$this->verifyText("//div[@id='browseValues']/div/div/table/tbody/tr[2]/td[1]", preg_quote($record1['text']));
$this->openCiviPage('profile/edit', "reset=1&id=$id&gid=$gid", "//div[@id='crm-profile-block']/a");
$this->click("//div[@id='crm-profile-block']/a");
$this->openCiviPage('profile/edit', "reset=1&id=$id&gid=$gid", "//a/span[contains(text(), 'Add New Record')]");
$this->click("//a/span[contains(text(), 'Add New Record')]");
$record2 = $this->_addRecords();
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->verifyText("//div[@id='browseValues']/div/div/table/tbody/tr[3]/td[1]", preg_quote($record2['text']));
// Check Max Record Limit
$this->verifyElementNotPresent("//div[@id='crm-profile-block']/a/span");
$this->verifyElementNotPresent("//a/span[contains(text(), 'Add New Record')]");
//Check for edit functionality
// Because it tends to cause problems, all uses of sleep() must be justified in comments
......@@ -230,8 +230,8 @@ class WebTest_Profile_MultiRecordProfileAddTest extends CiviSeleniumTestCase {
$this->click("//div[@id='browseValues']/div/div/table/tbody/tr/td[3]/span/a[text()='Edit']");
$this->waitForElementPresent("//html/body/div[5]");
$this->verifyText("//div[@id='browseValues']/div/div/table/thead/tr/th[1]", preg_quote($params['textFieldLabel']));
$this->type("//div[@id='profile-dialog']/div/form/div[2]/div/div/div[2]/input", $recordNew['text'].'edit');
$this->click("//div[@id='profile-dialog']/div/form/div[2]/div[2]/span/input[@id='_qf_Edit_next']");
$this->type("//div[@id='profile-dialog']/div/form/div[2]/div/div[2]/input", $recordNew['text'].'edit');
$this->click("//div[@id='profile-dialog']/div/form/div[3]/span/input[@id='_qf_Edit_next']");
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->verifyText("//div[@id='browseValues']/div/div/table/tbody/tr[1]/td[1]", preg_quote($recordNew['text'].'edit'));
......@@ -353,7 +353,7 @@ class WebTest_Profile_MultiRecordProfileAddTest extends CiviSeleniumTestCase {
function _addRecords($context = 'Edit') {
$this->waitForPageToLoad($this->getTimeoutMsec());
$params['text'] = 'text' . substr(sha1(rand()), 0, 3);
$this->type("//div[@id='crm-profile-block']/div/div/div[2]/input[@type='text']", $params['text']);
$this->type("//div[@id='crm-profile-block']/div/div[2]/input[@type='text']", $params['text']);
if ($context == 'Create') {
$params['firstname'] = 'John' . substr(sha1(rand()), 0, 3);
$this->type('first_name', $params['firstname']);
......@@ -362,8 +362,8 @@ class WebTest_Profile_MultiRecordProfileAddTest extends CiviSeleniumTestCase {
$params['email'] = $params['firstname'].$params['lastname'].'@exa.com';
$this->type('email-Primary', $params['email']);
}
$this->waitForElementPresent("//div[@id='crm-profile-block']/div//div/div[2]/select");
$this->select("//div[@id='crm-profile-block']/div//div/div[2]/select",'value=1');
$this->waitForElementPresent("//div[@id='crm-profile-block']//div/div[2]/select");
$this->select("//div[@id='crm-profile-block']//div/div[2]/select",'value=1');
$this->click('_qf_Edit_next');
return $params;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment