//Is custom group created?
$this->waitForText('crm-notification-container', "Your custom field set '{$customGroupTitle}' has been added. You can add custom fields now.");
- $url = $this->parseURL();
- $group_id = $url['queryString']['gid'];
- $this->assertType('numeric', $group_id);
-
- return $group_id;
+ return $this->urlArg('gid');
}
//Adds a new custom field to a specfied custom field group, using the given
// add a contact to the group to test release respondents
$firstName3 = substr(sha1(rand()), 0, 7);
$this->webtestAddContact($firstName3, "James", "$firstName3.james@example.org");
- $url = $this->getLocation();
- $id = explode('cid=', $url);
+ $id = $this->urlArg('cid');
$sortName3 = "James, $firstName3";
// add contact to group
// Adding contact
$firstName1 = substr(sha1(rand()), 0, 7);
$this->webtestAddContact($firstName1, "Smith", "$firstName1.smith@example.org");
- $url1 = explode('cid=', $this->getLocation());
- $id1 = $url1[1];
+ $id1 = $this->urlArg('cid');
// add contact to group
// visit group tab
$firstName2 = substr(sha1(rand()), 0, 7);
$this->webtestAddContact($firstName2, "John", "$firstName2.john@example.org");
- $url2 = explode('cid=', $this->getLocation());
- $id2 = $url2[1];
+ $id2 = $this->urlArg('cid');
// add contact to group
// visit group tab
$this->waitForPageToLoad($this->getTimeoutMsec());
// get custom group id
- $elements = $this->parseURL();
- $customGrpId1 = $elements['queryString']['gid'];
+ $customGrpId1 = $this->urlArg('gid');
$customId = $this->_testGetCustomFieldId($customGrpId1);
$cusId_1 = 'custom_' . $customId[0] . '_-1';
$firstNameSoft = "John_".substr(sha1(rand()), 0, 5);
$lastNameSoft = "Doe_".substr(sha1(rand()), 0, 5);
$this->webtestAddContact( $firstNameSoft, $lastNameSoft );
- $url = $this->parseURL( );
- $cid = $url['queryString']['cid'];
- $this->assertType('numeric', $cid);
+ $cid = $this->urlArg('cid');
//advance search for created contacts
$this->openCiviPage('contact/search/advanced', 'reset=1', '_qf_Advanced_refresh');
//Is custom group created?
$this->waitForText('crm-notification-container', "Your custom field set '{$customGroupTitle}' has been added. You can add custom fields now.");
- $matches = array();
- preg_match('/gid=([0-9]+)/', $this->getLocation(), $matches);
- $customGroupId = $matches[1];
+ $customGroupId = $this->urlArg('gid');
// Add contact reference fields
$contactRefFieldLabel1 = 'contact_ref_' . substr(sha1(rand()), 0, 4);
$this->click("xpath=//div[@id='field_page']//table/tbody/tr[1]/td[8]/span[1]/a[text()='Edit Field']");
$this->waitForPageToLoad($this->getTimeoutMsec());
- $matches = array();
- preg_match('/&id=([0-9]+)/', $this->getLocation(), $matches);
- $contactRefFieldID1 = $matches[1];
+ $contactRefFieldID1 = $this->urlArg('id');
$this->openCiviPage('admin/custom/group/field', "reset=1&action=browse&gid={$customGroupId}");
$this->click("xpath=//div[@id='field_page']//table/tbody/tr[2]/td[8]/span[1]/a[text()='Edit Field']");
$this->waitForPageToLoad($this->getTimeoutMsec());
- $matches = array();
- preg_match('/&id=([0-9]+)/', $this->getLocation(), $matches);
- $contactRefFieldID2 = $matches[1];
+ $contactRefFieldID2 = $this->urlArg('id');
// Visit custom group preview page
$this->openCiviPage('admin/custom/group', "action=preview&reset=1&id={$customGroupId}");
$email = $this->webtestAddContact($firstName, $lastName, TRUE);
// Get the contact id of the new contact
- $contactUrl = $this->parseURL();
- $cid = $contactUrl['queryString']['cid'];
- $this->assertType('numeric', $cid);
+ $cid = $this->urlArg('cid');
//got to the new cms user form
$this->openCiviPage('contact/view/useradd', "reset=1&action=add&cid={$cid}");
//Is custom group created?
$this->assertTrue($this->isTextPresent("Your custom field set '{$customGroupTitle}' has been added."));
- $url = explode('gid=', $this->getLocation());
- $gid = $url[1];
+ $gid = $this->urlArg('gid');
$fieldLabel = "custom_field_for_{$contactSubType}" . substr(sha1(rand()), 0, 4);
$this->type('label', $fieldLabel);
$this->webtestAddContact($fields['first_name']['default_value'], $fields['last_name']['default_value'], $fields['email']['default_value']);
// Get contact id from url.
- $matches = array();
- preg_match('/cid=([0-9]+)/', $this->getLocation(), $matches);
- $contactId = $matches[1];
+ $contactId = $this->urlArg('cid');
// Create profile for contact
$profileName = "Profile_" . substr(sha1(rand()), 0, 7);
$this->type('title', $profileName);
$this->click('_qf_Group_next-top');
$this->waitForPageToLoad($this->getTimeoutMsec());
- $elements = $this->parseURL();
- $profileId = $elements['queryString']['gid'];
+ $profileId = $this->urlArg('gid');
// Add field to the profile.
foreach ($fields as $key => $values) {
$name = $this->getText("xpath=//div[@class='crm-summary-display_name']");
// Get contact id from url.
- $matches = array();
- preg_match('/cid=([0-9]+)/', $this->getLocation(), $matches);
- $contactId = $matches[1];
+ $contactId = $this->urlArg('cid');
// Select Your Editor
$this->_selectEditor('CKEditor');
// verify text
$this->waitForElementPresent("xpath=//table//tbody/tr/td[1][text()= '$tagSetName']");
- $this->click("xpath=//table//tbody/tr/td[1][text()= '$tagSetName']/following-sibling::td[7]/span/a[text()= 'Edit']");
+ $this->clickLink("xpath=//table//tbody/tr/td[1][text()= '$tagSetName']/following-sibling::td[7]/span/a[text()= 'Edit']");
- $this->waitForPageToLoad($this->getTimeoutMsec());
-
- // Get contact id from url.
- $matches = array();
- preg_match('/id=([0-9]+)/', $this->getLocation(), $matches);
-
- return $matches[1];
+ return $this->urlArg('id');
}
}
$this->webtestAddContact();
// get cid of new contact
- $queryParams = $this->parseURL();
- $cids[] = $queryParams['queryString']['cid'];
+ $cids[] = $this->urlArg('cid');
// update email of new contact
$this->click("//ul[@id='actions']/li/a/span[text()='Edit']");
$locationUrl = $this->getLocation();
$editUrl = str_replace('/view?', '/edit?', $locationUrl);
$this->open($editUrl);
+ $this->waitForPageToLoad($this->getTimeoutMsec());
// Modify profile field values
// contact details section
// Get the price set id ($sid) by retrieving and parsing the URL of the New Price Field form
// which is where we are after adding Price Set.
- $elements = $this->parseURL();
- $sid = $elements['queryString']['sid'];
+ $sid = $this->urlArg('sid');
$this->assertType('numeric', $sid);
$validStrings = array();
// Get the price set id ($sid) by retrieving and parsing the URL of the New Price Field form
// which is where we are after adding Price Set.
- $elements = $this->parseURL();
- $sid = $elements['queryString']['sid'];
+ $sid = $this->urlArg('sid');
$this->assertType('numeric', $sid);
$validStrings = array();
// Get the price set id ($sid) by retrieving and parsing the URL of the New Price Field form
// which is where we are after adding Price Set.
- $elements = $this->parseURL();
- $sid = $elements['queryString']['sid'];
+ $sid = $this->urlArg('sid');
$this->assertType('numeric', $sid);
$validStrings = array();
// Get the price set id ($sid) by retrieving and parsing the URL of the New Price Field form
// which is where we are after adding Price Set.
- $elements = $this->parseURL();
- $sid = $elements['queryString']['sid'];
+ $sid = $this->urlArg('sid');
$this->assertType('numeric', $sid);
$validStrings = array();
// Get the price set id ($sid) by retrieving and parsing the URL of the New Price Field form
// which is where we are after adding Price Set.
- $elements = $this->parseURL();
- $sid = $elements['queryString']['sid'];
+ $sid = $this->urlArg('sid');
$this->assertType('numeric', $sid);
$validStrings = array();
$isDefault
);
- $this->webtestAddContact( $firstName, "Anderson", true );
+ $this->webtestAddContact($firstName, "Anderson", true);
// Get the contact id of the new contact
$contactUrl = $this->parseURL();
$url = $this->getLocation();
$url = str_replace('mode=live', 'mode=test', $url);
$this->open($url);
+ $this->waitForPageToLoad($this->getTimeoutMsec());
// start filling out contribution form
$this->waitForElementPresent('payment_processor_id');
$url = $this->getLocation();
$url = str_replace('mode=live', 'mode=test', $url);
$this->open($url);
+ $this->waitForPageToLoad($this->getTimeoutMsec());
// start filling out contribution form
$this->waitForElementPresent('payment_processor_id');
//adding contact for membership sign up
$this->webtestAddContact($firstName, $lastName, $email);
- $urlElements = $this->parseURL();
- print_r($urlElements);
- $cid = $urlElements['queryString']['cid'];
- $this->assertType('numeric', $cid);
+ $cid = $this->urlArg('cid');
// We need a payment processor
$processorName = "Webtest Dummy" . substr(sha1(rand()), 0, 7);
$this->type("last_name", $lastName);
$this->clickLink("_qf_Edit_next", "profilewrap4");
- $urlElements = $this->parseURL();
- print_r($urlElements);
- $cid = $urlElements['queryString']['id'];
- $this->assertType('numeric', $cid);
+ $cid = $this->urlArg('id');
// Is status message correct?
$this->assertTextPresent("Thank you. Your information has been saved.", "Save successful status message didn't show up after saving profile to update testUserName!");
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->assertTrue($this->isTextPresent("Your custom field '$fieldTitle' has been saved."));
- $url = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']/div[2]/table/tbody//tr/td[1][text()='$fieldTitle']/../td[8]/span/a@href"));
- $fieldId = $url[1];
+ $fieldId = $this->urlArg('id', $this->getAttribute("xpath=//div[@id='field_page']/div[2]/table/tbody//tr/td[1][text()='$fieldTitle']/../td[8]/span/a@href"));
// Enable CiviCampaign module if necessary
$this->enableComponents("CiviCampaign");
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->assertTrue($this->isTextPresent("Your custom field '$fieldTitle' has been saved."));
- $url = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']/div[2]/table/tbody//tr/td[1]/span[text()='$fieldTitle']/../td[8]/span/a@href"));
- $fieldId = $url[1];
+ $fieldId = $this->urlArg('id', $this->getAttribute("xpath=//div[@id='field_page']/div[2]/table/tbody//tr/td[1]/span[text()='$fieldTitle']/../td[8]/span/a@href"));
// Enable CiviCampaign module if necessary
$this->enableComponents("CiviCampaign");
$this->click('_qf_MembershipType_upload-bottom');
$this->waitForElementPresent('link=Add Membership Type');
$this->assertTrue($this->isTextPresent("The membership type '$title1' has been saved."));
- $typeUrl = explode('&id=', $this->getAttribute("xpath=//div[@id='membership_type']/div[2]/table/tbody//tr/td[1][text()='{$title1}']/../td[10]/span/a[3]@href"));
- $typeId = $typeUrl[1];
+ $typeId = $this->urlArg('id', $this->getAttribute("xpath=//div[@id='membership_type']/div[2]/table/tbody//tr/td[1][text()='{$title1}']/../td[10]/span/a[3]@href"));
// open contact
$this->openCiviPage("contact/view/rel", "cid={$cid}&action=add&reset=1");
$this->type("last_name", $lastName);
$this->clickLink("_qf_Edit_next", "profilewrap4");
- $urlElements = $this->parseURL();
- $cid = $urlElements['queryString']['id'];
+ $cid = $this->urlArg('id');
$this->assertType('numeric', $cid);
// Is status message correct?
$this->assertTextPresent("Thank you. Your information has been saved.", "Save successful status message didn't show up after saving profile to update testUserName!");
$this->_testOfflineContribution($firstName, $lastName, $email, $amount, "Pending");\r
$this->click("xpath=//div[@id='Contributions']//table/tbody/tr[1]/td[8]/span/a[text()='Edit']");\r
$this->waitForPageToLoad($this->getTimeoutMsec());\r
- $elements = $this->parseURL();\r
- $contId = $elements['queryString']['id'];\r
+ $contId = $this->urlArg('id');\r
$this->select("contribution_status_id", "label=Completed");\r
$this->click("_qf_Contribution_upload");\r
$this->waitForPageToLoad($this->getTimeoutMsec());\r
//click through to the Contribution edit screen\r
$this->click("xpath=//div[@id='Contributions']//table/tbody/tr[1]/td[8]/span/a[text()='Edit']");\r
$this->waitForElementPresent("_qf_Contribution_upload-bottom");\r
- $elements = $this->parseURL();\r
- $contId = $elements['queryString']['id'];\r
+ $contId = $this->urlArg('id');\r
$this->waitForElementPresent("product_name_0");\r
$this->select('product_name_0', "label=$premiumName2 ( $sku2 )");\r
// Clicking save.\r
//click through to the Contribution edit screen\r
$this->click("xpath=//div[@id='Contributions']//table/tbody/tr[1]/td[8]/span/a[text()='Edit']");\r
$this->waitForElementPresent("_qf_Contribution_upload-bottom");\r
- $elements = $this->parseURL();\r
- $contId = $elements['queryString']['id'];\r
+ $contId = $this->urlArg('id');\r
$this->waitForElementPresent("product_name_0");\r
$this->select('product_name_0', "value=0");\r
// Clicking save.\r
$this->_testOfflineContribution($firstName, $lastName, $email, $amount);\r
$this->click("xpath=//div[@id='Contributions']//table/tbody/tr[1]/td[8]/span/a[text()='Edit']");\r
$this->waitForPageToLoad($this->getTimeoutMsec());\r
- $elements = $this->parseURL();\r
- $contId = $elements['queryString']['id'];\r
+ $contId = $this->urlArg('id');\r
//change payment processor to newly created value\r
$this->select("payment_instrument_id", "label=$label");\r
$this->click("_qf_Contribution_upload");\r
$this->waitForPageToLoad($this->getTimeoutMsec());\r
//Contribution status\r
$this->select("contribution_status_id", "label=Refunded");\r
- $elements = $this->parseURL();\r
- $contId = $elements['queryString']['id'];\r
+ $contId = $this->urlArg('id');\r
$this->click("_qf_Contribution_upload");\r
$this->waitForPageToLoad($this->getTimeoutMsec());\r
\r
$this->waitForPageToLoad($this->getTimeoutMsec());\r
//Contribution status\r
$this->select("contribution_status_id", "label=Cancelled");\r
- $elements = $this->parseURL();\r
- $contId = $elements['queryString']['id'];\r
+ $contId = $this->urlArg('id');\r
$this->click("_qf_Contribution_upload");\r
$this->waitForPageToLoad($this->getTimeoutMsec());\r
\r
$this->waitForPageToLoad($this->getTimeoutMsec());\r
//Contribution status\r
$this->select("financial_type_id", "value=3");\r
- $elements = $this->parseURL();\r
- $contId = $elements['queryString']['id'];\r
+ $contId = $this->urlArg('id');\r
$this->click("_qf_Contribution_upload");\r
$this->waitForPageToLoad($this->getTimeoutMsec());\r
\r
$this->assertStringsPresent($eventFees);
}
- $elements = $this->parseURL();
- return $elements['queryString']['id'];
+ return $this->urlArg('id');
}
function _testVerifyRegisterPage($registerStrings) {
// Get the price set id ($sid) by retrieving and parsing the URL of the New Price Field form
// which is where we are after adding Price Set.
- $elements = $this->parseURL();
- $sid = $elements['queryString']['sid'];
+ $sid = $this->urlArg('sid');
$this->assertType('numeric', $sid);
$validStrings = array();
// Get the price set id ($sid) by retrieving and parsing the URL of the New Price Field form
// which is where we are after adding Price Set.
- $elements = $this->parseURL();
- $sid = $elements['queryString']['sid'];
+ $sid = $this->urlArg('sid');
$this->assertType('numeric', $sid);
$validStrings = array();
// Get the price set id ($sid) by retrieving and parsing the URL of the New Price Field form
// which is where we are after adding Price Set.
- $elements = $this->parseURL();
- $sid = $elements['queryString']['sid'];
+ $sid = $this->urlArg('sid');
$this->assertType('numeric', $sid);
$validStrings = array();
// Get the price set id ($sid) by retrieving and parsing the URL of the New Price Field form
// which is where we are after adding Price Set.
- $elements = $this->parseURL();
- $sid = $elements['queryString']['sid'];
+ $sid = $this->urlArg('sid');
$this->assertType('numeric', $sid);
$validStrings = array();
$this->waitForPageToLoad($this->getTimeoutMsec());
// get custom group id
- $elements = $this->parseURL();
- $customGrpId1 = $elements['queryString']['gid'];
+ $customGrpId1 = $this->urlArg('gid');
$customId = $this->_testGetCustomFieldId($customGrpId1);
$this->waitForPageToLoad($this->getTimeoutMsec());
// get custom group id
- $elements = $this->parseURL();
- $customGrpId1 = $elements['queryString']['gid'];
+ $customGrpId1 = $this->urlArg('gid');
$customId = $this->_testGetCustomFieldId($customGrpId1);
$this->type('title', $profilename);
$this->click('_qf_Group_next-top');
$this->waitForPageToLoad($this->getTimeoutMsec());
- $elements = $this->parseURL();
- $profileId = $elements['queryString']['gid'];
+ $profileId = $this->urlArg('gid');
//Add field to profile_testCreateProfile
foreach ($profilefield as $key => $value) {
// Wait for "saved" status msg
$this->waitForPageToLoad($this->getTimeoutMsec());
- $elements = $this->parseURL();
- $eventPageId = $elements['queryString']['id'];
+ $this->waitForText('crm-notification-container', "'Registration' information has been saved.");
- $this->waitForTextPresent("'Registration' information has been saved.");
-
- return $eventPageId;
+ return $this->urlArg('id');
}
function _testEventRegistration($eventPageId, $customId, $firstName, $lastName,
$this->waitForElementPresent('_qf_Event_upload-bottom');
$this->waitForPageToLoad($this->getTimeoutMsec());
$text = "'Event' information has been saved.";
- $this->assertTrue($this->isTextPresent($text), 'Missing text: ' . $text);
+ $this->waitForText('crm-notification-container', $text);
// parse URL to grab the contribution page id
- $elements = $this->parseURL();
- $pageId = $elements['queryString']['id'];
- return $pageId;
+ return $this->urlArg('id');
}
function _testParticipantSearchEventName($eventName, $lastNameDonar, $firstNameDonar, $firstNameCreator, $lastNameCreator, $amount) {
// get text field Id.
$this->click("xpath=//div[@id='field_page']//table/tbody/tr[1]/td[9]/span[1]/a[2]");
$this->waitForPageToLoad($this->getTimeoutMsec());
- $matches = array();
- preg_match('/fid=([0-9]+)/', $this->getLocation(), $matches);
- $textFieldId = $matches[1];
+ $textFieldId = $this->urlArg('fid');
$this->open($pricesetLoc);
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->click("xpath=//div[@id='field_page']//table/tbody/tr[2]/td[8]/a");
$this->waitForPageToLoad($this->getTimeoutMsec());
$selectFieldLoc = $this->getLocation();
- $matches = array();
- preg_match('/fid=([0-9]+)/', $this->getLocation(), $matches);
- $selectFieldId = $matches[1];
+ $selectFieldId = $this->urlArg('fid');
// get select field ids
// get select field option1
$this->click("xpath=//div[@id='field_page']//table/tbody/tr[1]/td[7]/span[1]/a[1]");
$this->waitForPageToLoad($this->getTimeoutMsec());
- $matches = array();
- preg_match('/oid=([0-9]+)/', $this->getLocation(), $matches);
- $selectFieldOp1 = $matches[1];
+ $selectFieldOp1 = $this->urlArg('oid');
$this->open($selectFieldLoc);
$this->waitForPageToLoad($this->getTimeoutMsec());
// get select field option2
$this->click("xpath=//div[@id='field_page']//table/tbody/tr[2]/td[7]/span[1]/a[1]");
$this->waitForPageToLoad($this->getTimeoutMsec());
- $matches = array();
- preg_match('/oid=([0-9]+)/', $this->getLocation(), $matches);
- $selectFieldOp2 = $matches[1];
+ $selectFieldOp2 = $this->urlArg('oid');
// create event.
$eventTitle = 'Meeting - ' . substr(sha1(rand()), 0, 7);
$pricesetLoc = $this->getLocation();
// get text field Id.
- $this->click("xpath=//div[@id='field_page']//table/tbody/tr[1]/td[9]/span[1]/a[2]");
- $this->waitForPageToLoad($this->getTimeoutMsec());
- $matches = array();
- preg_match('/fid=([0-9]+)/', $this->getLocation(), $matches);
- $textFieldId = $matches[1];
+ $this->clickLink("xpath=//div[@id='field_page']//table/tbody/tr[1]/td[9]/span[1]/a[2]");
+ $textFieldId = $this->urlArg('fid');
$this->open($pricesetLoc);
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->click("xpath=//div[@id='field_page']//table/tbody/tr[2]/td[8]/a");
$this->waitForPageToLoad($this->getTimeoutMsec());
$selectFieldLoc = $this->getLocation();
- $matches = array();
- preg_match('/fid=([0-9]+)/', $this->getLocation(), $matches);
- $selectFieldId = $matches[1];
+ $selectFieldId = $this->urlArg('fid');
// get select field ids
// get select field option1
$this->click("xpath=//div[@id='field_page']//table/tbody/tr[1]/td[7]/span[1]/a[1]");
$this->waitForPageToLoad($this->getTimeoutMsec());
- $matches = array();
- preg_match('/oid=([0-9]+)/', $this->getLocation(), $matches);
- $selectFieldOp1 = $matches[1];
+ $selectFieldOp1 = $this->urlArg('oid');
$this->open($selectFieldLoc);
$this->waitForPageToLoad($this->getTimeoutMsec());
// get select field option2
$this->click("xpath=//div[@id='field_page']//table/tbody/tr[2]/td[7]/span[1]/a[1]");
$this->waitForPageToLoad($this->getTimeoutMsec());
- $matches = array();
- preg_match('/oid=([0-9]+)/', $this->getLocation(), $matches);
- $selectFieldOp2 = $matches[1];
+ $selectFieldOp2 = $this->urlArg('oid');
// create event.
$eventTitle = 'Meeting - ' . substr(sha1(rand()), 0, 7);
$pricesetLoc = $this->getLocation();
// get text field Id.
- $this->click("xpath=//div[@id='field_page']//table/tbody/tr[1]/td[9]/span[1]/a[2]");
- $this->waitForPageToLoad($this->getTimeoutMsec());
- $matches = array();
- preg_match('/fid=([0-9]+)/', $this->getLocation(), $matches);
- $textFieldId = $matches[1];
+ $this->clickLink("xpath=//div[@id='field_page']//table/tbody/tr[1]/td[9]/span[1]/a[2]");
+ $textFieldId = $this->urlArg('fid');
$this->open($pricesetLoc);
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->click("xpath=//div[@id='field_page']//table/tbody/tr[2]/td[8]/a");
$this->waitForPageToLoad($this->getTimeoutMsec());
$selectFieldLoc = $this->getLocation();
- $matches = array();
- preg_match('/fid=([0-9]+)/', $this->getLocation(), $matches);
- $selectFieldId = $matches[1];
+ $selectFieldId = $this->urlArg('fid');
// get select field ids
// get select field option1
$this->click("xpath=//div[@id='field_page']//table/tbody/tr[1]/td[7]/span[1]/a[1]");
$this->waitForPageToLoad($this->getTimeoutMsec());
- $matches = array();
- preg_match('/oid=([0-9]+)/', $this->getLocation(), $matches);
- $selectFieldOp1 = $matches[1];
+ $selectFieldOp1 = $this->urlArg('oid');
$this->open($selectFieldLoc);
$this->waitForPageToLoad($this->getTimeoutMsec());
// get select field option2
$this->click("xpath=//div[@id='field_page']//table/tbody/tr[2]/td[7]/span[1]/a[1]");
$this->waitForPageToLoad($this->getTimeoutMsec());
- $matches = array();
- preg_match('/oid=([0-9]+)/', $this->getLocation(), $matches);
- $selectFieldOp2 = $matches[1];
+ $selectFieldOp2 = $this->urlArg('oid');
// create event.
$eventTitle = 'Meeting - ' . substr(sha1(rand()), 0, 7);
// get text field Id.
$this->click("xpath=//div[@id='field_page']//table/tbody/tr[1]/td[9]/span[1]/a[2]");
$this->waitForPageToLoad($this->getTimeoutMsec());
- $matches = array();
- preg_match('/fid=([0-9]+)/', $this->getLocation(), $matches);
- $textFieldId = $matches[1];
+ $textFieldId = $this->urlArg('fid');
$this->open($pricesetLoc);
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->click("xpath=//div[@id='field_page']//table/tbody/tr[2]/td[8]/a");
$this->waitForPageToLoad($this->getTimeoutMsec());
$selectFieldLoc = $this->getLocation();
- $matches = array();
- preg_match('/fid=([0-9]+)/', $this->getLocation(), $matches);
- $selectFieldId = $matches[1];
+ $selectFieldId = $this->urlArg('fid');
// get select field ids
// get select field option1
$this->click("xpath=//div[@id='field_page']//table/tbody/tr[1]/td[7]/span[1]/a[1]");
$this->waitForPageToLoad($this->getTimeoutMsec());
- $matches = array();
- preg_match('/oid=([0-9]+)/', $this->getLocation(), $matches);
- $selectFieldOp1 = $matches[1];
+ $selectFieldOp1 = $this->urlArg('oid');
$this->open($selectFieldLoc);
$this->waitForPageToLoad($this->getTimeoutMsec());
// get select field option2
$this->click("xpath=//div[@id='field_page']//table/tbody/tr[2]/td[7]/span[1]/a[1]");
$this->waitForPageToLoad($this->getTimeoutMsec());
- $matches = array();
- preg_match('/oid=([0-9]+)/', $this->getLocation(), $matches);
- $selectFieldOp2 = $matches[1];
+ $selectFieldOp2 = $this->urlArg('oid');
// create event.
$eventTitle = 'Meeting - ' . substr(sha1(rand()), 0, 7);
$this->waitForPageToLoad($this->getTimeoutMsec());\r
\r
// parse URL to grab the batch ID\r
- $elements = $this->parseURL();\r
- $batchId = $elements['queryString']['bid'];\r
+ $batchId = $this->urlArg('bid');\r
return $batchId;\r
}\r
\r
$firstName1 = substr(sha1(rand()), 0, 7);
$email1 = 'mail_' . substr(sha1(rand()), 0, 7) . '@example.com';
$this->webtestAddContact($firstName1, 'Anderson', $email1);
- $url = explode('&cid=', $this->getLocation());
- $id1 = $url[1];
+ $id1 = $this->urlArg('cid');
$firstName2 = substr(sha1(rand()), 0, 7);
$email2 = 'mail_' . substr(sha1(rand()), 0, 7) . '@example.com';
$this->webtestAddContact($firstName2, 'Anderson', $email2);
- $url = explode('&cid=', $this->getLocation());
- $id2 = $url[1];
+ $id2 = $this->urlArg('cid');
$headers = array(
'target_contact_id' => 'Contact ID',
//Is custom group created?
$this->waitForText('crm-notification-container', "Your custom field set '{$customGroupTitle}' has been added. You can add custom fields now.");
- $url = explode('gid=', $this->getLocation());
- $gid = $url[1];
+ $gid = $this->urlArg('gid');
// create custom field "alphanumeric text"
$customField = 'Custom field ' . substr(sha1(rand()), 0, 4);
$this->waitForElementPresent('_qf_Field_cancel-bottom');
//Is custom group created?
- $this->assertTrue($this->isTextPresent("Your custom field set '{$customGroupTitle}' has been added. You can add custom fields now."));
- $url = explode('gid=', $this->getLocation());
- $gid = $url[1];
+ $this->waitForText('crm-notification-container', $customGroupTitle);
+ $gid = $this->urlArg('gid');
// create another custom field - Date
$customField = 'Custom field ' . substr(sha1(rand()), 0, 4);
$firstName3 = 'Ma' . substr(sha1(rand()), 0, 4);
$this->webtestAddContact($firstName3, "Anderson", TRUE);
$sortName3 = "$firstName3 Anderson";
- $this->waitForPageToLoad($this->getTimeoutMsec());
- $url1 = explode('&cid=', $this->getLocation());
- $id1 = $url1[1];
+ $id1 = $this->urlArg('cid');
$firstName4 = 'Ma' . substr(sha1(rand()), 0, 4);
$this->webtestAddContact($firstName4, "Anderson", TRUE);
$sortName4 = "$firstName4 Anderson";
- $this->waitForPageToLoad($this->getTimeoutMsec());
- $url2 = explode('&cid=', $this->getLocation());
- $id2 = $url2[1];
+ $id2 = $this->urlArg('cid');
// Get sample import data.
list($headers, $rows, $customDataVerify) = $this->_individualCustomCSVData($customGroupTitle, $firstName1, $firstName2,
$this->waitForElementPresent("css=div.ac_results-inner li");
// Visit contact summary page.
- $this->click("css=div.ac_results-inner li");
- $this->waitForPageToLoad($this->getTimeoutMsec());
+ $this->clickLink("css=div.ac_results-inner li");
// Get contact id from url.
- $matches = array();
- preg_match('/cid=([0-9]+)/', $this->getLocation(), $matches);
- $contactIds[] = $matches[1];
+ $contactIds[] = $this->urlArg('cid');
}
return $contactIds;
$this->type("xpath=//div[@class='crm-block crm-form-block crm-event-searchevent-form-block']/table/tbody/tr/td/input",$params['title']);
$this->click("_qf_SearchEvent_refresh");
$this->waitForPageToLoad($this->getTimeoutMsec());
- $this->click("link=" . $params['title']);
+ $this->clickLink("link=" . $params['title']);
- $this->waitForPageToLoad($this->getTimeoutMsec());
-
- $matches = array();
- preg_match('/id=([0-9]+)/', $this->getLocation(), $matches);
- $params['event_id'] = $matches[1];
+ $params['event_id'] = $this->urlArg('id');
return $params;
}
// verify event input on info page
// start at Manage Events listing
$this->openCiviPage('event/manage', 'reset=1');
- $this->click("link=" . $params['title']);
+ $this->clickLink("link=" . $params['title']);
- $this->waitForPageToLoad($this->getTimeoutMsec());
-
- $matches = array();
- preg_match('/id=([0-9]+)/', $this->getLocation(), $matches);
- $params['event_id'] = $matches[1];
+ $params['event_id'] = $this->urlArg('id');;
return $params;
}
$this->webtestAddContact($firstName, "Mailson", "mailino$firstName@mailson.co.in");
// Get contact id from url.
- $matches = array();
- preg_match('/cid=([0-9]+)/', $this->getLocation(), $matches);
- $contactId = $matches[1];
+ $contactId = $this->urlArg('cid');
// go to group tab and add to mailing group
$this->click("css=li#tab_group a");
$this->webtestAddContact($firstName, "Mailson", "mailino$firstName@mailson.co.in");
// Get contact id from url.
- $matches = array();
- preg_match('/cid=([0-9]+)/', $this->getLocation(), $matches);
- $contactId = $matches[1];
+ $contactId = $this->urlArg('cid');
// go to group tab and add to mailing group
$this->click("css=li#tab_group a");
$email = $this->webtestAddContact($fname, $lname, TRUE);
// Get the contact id of the newly added contact
- $urlElements = $this->parseURL();
- $cid = $urlElements['queryString']['cid'];
- $this->assertNotEmpty($cid, 'Could not find cid after adding contact');
+ $cid = $this->urlArg('cid');
// Send an email to the added contact
$this->openCiviPage("activity/email/add", "action=add&reset=1&cid={$cid}&selectedChild=activity&atype=3");
// Get the price set id ($sid) by retrieving and parsing the URL of the New Price Field form
// which is where we are after adding Price Set.
- $elements = $this->parseURL();
- $sid = $elements['queryString']['sid'];
+ $sid = $this->urlArg('sid');
$this->assertType('numeric', $sid);
$fields = array("National Membership $title" => 'Radio');
$this->click("//li[@id='tab_rel']/a");
$this->waitForElementPresent("xpath=//div[@id='current-relationships']//div//table/tbody//tr/td[9]/span/a[text()='Edit']");
$this->click("xpath=//div[@id='current-relationships']//div//table/tbody//tr/td[9]/span/a[text()='Edit']");
- $matches = array();
- preg_match('/cid=([0-9]+)/', $this->getLocation(), $matches);
- $id = $matches[1];
+ $id = $this->urlArg('cid');
$this->waitForElementPresent('is_active');
//disable relationship
$url = $this->getLocation();
$url = str_replace('mode=live', 'mode=test', $url);
$this->open($url);
+ $this->waitForPageToLoad($this->getTimeoutMsec());
// start filling membership form
$this->waitForElementPresent('payment_processor_id');
// Get the price set id ($sid) by retrieving and parsing the URL of the New Price Field form
// which is where we are after adding Price Set.
- $elements = $this->parseURL();
- $sid = $elements['queryString']['sid'];
+ $sid = $this->urlArg('sid');
$this->assertType('numeric', $sid);
$fields = array(
// Get the price set id ($sid) by retrieving and parsing the URL of the New Price Field form
// which is where we are after adding Price Set.
- $elements = $this->parseURL();
- $sid = $elements['queryString']['sid'];
+ $sid = $this->urlArg('sid');
$this->assertType('numeric', $sid);
$fields = array("National Membership $title", "Radio");
// Get the price set id ($sid) by retrieving and parsing the URL of the New Price Field form
// which is where we are after adding Price Set.
- $elements = $this->parseURL();
- $sid = $elements['queryString']['sid'];
+ $sid = $this->urlArg('sid');
$this->assertType('numeric', $sid);
$fields = array(
// Get the price set id ($sid) by retrieving and parsing the URL of the New Price Field form
// which is where we are after adding Price Set.
- $elements = $this->parseURL();
- $sid = $elements['queryString']['sid'];
+ $sid = $this->urlArg('sid');
$this->assertType('numeric', $sid);
$fields = array("National Membership $title", "Radio");
$this->click('css=#memberSearch table tbody tr td span a.action-item-first');
$this->waitForElementPresent("_qf_MembershipView_cancel-bottom");
- $matches = array();
- preg_match('/id=([0-9]+)/', $this->getLocation(), $matches);
- $membershipCreatedId = $matches[1];
+ $membershipCreatedId = $this->urlArg('id');
$memberSince = date('F jS, Y');
$this->click('css=#memberSearch table tbody tr td span a.action-item-first');
$this->waitForElementPresent("_qf_MembershipView_cancel-bottom");
- $matches = array();
- preg_match('/id=([0-9]+)/', $this->getLocation(), $matches);
- $membershipRenewedId = $matches[1];
+ $membershipRenewedId = $this->urlArg('id');
//View Membership Record
$verifyMembershipData = array(
$lastName1 = 'An_' . substr(sha1(rand()), 0, 7);
$this->webtestAddContact($firstName1, $lastName1, TRUE);
$this->waitForText('crm-notification-container', "$firstName1 $lastName1 has been created.");
- $url = explode('&cid=', $this->getLocation());
- $cid = $url[1];
+ $cid = $this->urlArg('cid');
// create contribution page with randomized title and default params
$amountSection = TRUE;
$this->click('link=Use (create mode)');
$recordNew = $this->_addRecords('Create');
$this->waitForPageToLoad($this->getTimeoutMsec());
- $elements = $this->parseURL( );
-
+ $elements = $this->parseURL();
$gid = $elements['queryString']['gid'];
$id = $elements['queryString']['id'];
$this->waitForText('crm-notification-container', "Your CiviCRM Profile '{$profileTitle}' has been added. You can add fields to this profile now.");
// Get profile id (gid) from URL
- $elements = $this->parseURL();
- $profileId = $elements['queryString']['gid'];
+ $profileId = $this->urlArg('gid');
// Add Last Name field.
$this->click('field_name[0]');
$lastName = 'Anderson' . substr(sha1(rand()), 0, 7);
$this->webtestAddContact($firstName, $lastName);
- $cid = explode('&cid=', $this->getLocation());
+ $cid = $this->urlArg('cid');
//add contact to group
$this->waitForElementPresent("xpath=//li[@id='tab_group']/a");