}
function testContactMemberAdd() {
- $this->open($this->sboxPath);
$this->webtestLogin();
// Create a membership type to use for this test (defaults for this helper function are rolling 1 year membership)
$memTypeParams = $this->webtestAddMembershipType();
$lifeTimeMemTypeParams = $this->webtestAddMembershipType('rolling', 1, 'lifetime');
- // Go directly to the URL of the screen that you will be testing (New Individual).
$this->openCiviPage("contact/add", "reset=1&ct=Individual");
$firstName = "John_" . substr(sha1(rand()), 0, 7);
$this->select("membership_type_id[0]", "label={$memTypeParams['member_of_contact']}");
// Wait for membership type select to reload
$this->waitForTextPresent($memTypeParams['membership_type']);
+ // Because it tends to cause problems, all uses of sleep() must be justified in comments
+ // Sleep should never be used for wait for anything to load from the server
+ // Justification for this instance: FIXME
sleep(3);
$this->select("membership_type_id[1]", "label={$memTypeParams['membership_type']}");
'Source' => $sourceText,
);
$this->webtestVerifyTabularData($verifyData);
- $this->click("_qf_MembershipView_cancel-bottom");
-
- $this->waitForPageToLoad($this->getTimeoutMsec());
- $this->waitForElementPresent("xpath=//div[@id='memberships']/div/table/tbody//tr/td[1][text()='{$memTypeParams['membership_type']}']/../td[7]");
+ $this->clickLink("_qf_MembershipView_cancel-bottom", "xpath=//div[@id='memberships']/div/table/tbody//tr/td[1][text()='{$memTypeParams['membership_type']}']/../td[7]");
$this->click("xpath=//div[@id='memberships']/div/table/tbody//tr/td[1][text()='{$memTypeParams['membership_type']}']/../td[9]/span/a[2][text()='Edit']");
$this->waitForElementPresent("_qf_Membership_cancel-bottom");
}
function testMemberAddWithLifeTimeMembershipType() {
- $this->open($this->sboxPath);
$this->webtestLogin();
// Create a membership type to use for this test (defaults for this helper function are rolling 1 year membership)
$lifeTimeMemTypeParams = $this->webtestAddMembershipType('rolling', 1, 'lifetime');
- // Go directly to the URL of the screen that you will be testing (New Individual).
$this->openCiviPage("contact/add", "reset=1&ct=Individual");
$firstName = "John_" . substr(sha1(rand()), 0, 7);
// Wait for membership type select to reload
$this->waitForTextPresent($lifeTimeMemTypeParams['membership_type']);
+ // Because it tends to cause problems, all uses of sleep() must be justified in comments
+ // Sleep should never be used for wait for anything to load from the server
+ // Justification for this instance: FIXME
sleep(3);
$this->select("membership_type_id[1]", "label={$lifeTimeMemTypeParams['membership_type']}");