changePermissions($permission); // Log in as normal user $this->webtestLogin(); $this->openCiviPage('contact/add', 'reset=1&ct=Individual'); $firstName = "John" . substr(sha1(rand()), 0, 7); $lastName = "Smith" . substr(sha1(rand()), 0, 7); $email = $firstName . "@" . $lastName . ".com"; // fill in first name $this->type("first_name", $firstName); // fill in last name $this->type("last_name", $lastName); // fill in email $this->type("email_1_email", $email); // Clicking save. $this->click("_qf_Contact_upload_view"); $this->waitForPageToLoad($this->getTimeoutMsec()); $individualName = $this->getText("xpath=//div[@class='crm-summary-display_name']"); $this->waitForText('crm-notification-container', "$individualName has been created."); // submit dupe using profile/create as anonymous $this->openCiviPage('profile/create', 'gid=4&reset=1', '_qf_Edit_next'); $firstName = "John" . substr(sha1(rand()), 0, 7); $lastName = "Smith" . substr(sha1(rand()), 0, 7); // fill in first name $this->type("first_name", $firstName); // fill in last name $this->type("last_name", $lastName); // fill in email $this->type("email-Primary", $email); // click save $this->click("_qf_Edit_next"); $this->waitForTextPresent("A record already exists with the same information."); } }