open($this->sboxPath); // Logging in. Remember to wait for page to load. In most cases, // you can rely on 30000 as the value that allows your test to pass, however, // sometimes your test might fail because of this. In such cases, it's better to pick one element // somewhere at the end of page and use waitForElementPresent on it - this assures you, that whole // page contents loaded and you can continue your test execution. $this->webtestLogin(); $this->waitForPageToLoad($this->getTimeoutMsec()); // Advanced Search $this->openCiviPage('contact/search/advanced', 'reset=1', '_qf_Advanced_refresh'); $this->click('_qf_Advanced_refresh'); $this->waitForElementPresent('CIVICRM_QFID_ts_all_8'); $this->click('CIVICRM_QFID_ts_all_8'); $this->select('task', "label=Add Contacts to Event"); $this->click('Go'); // Select event. Based on label for now. $this->waitForElementPresent('event_id'); $this->select('event_id', "label=regexp:Rain-forest Cup Youth Soccer Tournament."); // Select role $this->click('role_id[2]'); // Select participant status $this->select('status_id', 'value=1'); // Setting registration source $this->type('source', 'Event StandaloneAddTest Webtest'); $this->assertElementContainsText('css=tr.crm-participant-form-block-source span.description', 'Source for this registration (if applicable).'); // Clicking save. $this->click('_qf_Participant_upload-bottom'); $this->waitForPageToLoad($this->getTimeoutMsec()); } }