open($this->sboxPath); // lets give profile related permision to anonymous user. $permission = array('edit-1-profile-create', 'edit-1-profile-edit', 'edit-1-profile-listings', 'edit-1-profile-view'); $this->changePermissions($permission); // Go directly to the URL of the screen that you will beadding New Individual. $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->assertElementContainsText('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."); } }