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(); // Add new Schedule Reminder $this->open($this->sboxPath . 'civicrm/admin/scheduleReminders?reset=1'); $this->open($this->sboxPath . 'civicrm/admin/scheduleReminders?action=add&reset=1'); $this->waitForElementPresent('_qf_ScheduleReminders_cancel-bottom'); // Fill Title $title = 'Title' . substr(sha1(rand()), 0, 4); $this->type('title', $title); // Fill Entity Details $this->click('entity_0'); $this->select('entity_0', 'label=Activity'); $this->addSelection('entity_1', 'label=Meeting'); $this->addSelection('entity_2', 'label=Completed'); $this->select('start_action_offset', 'label=1'); $this->select('start_action_condition', 'label=after'); $this->click('is_repeat'); $this->select('repetition_frequency_interval', 'label=1'); $this->click('recipient'); $this->select('recipient', 'label=Activity Assignees'); // Fill Subject $subject = 'subject' . substr(sha1(rand()), 0, 4); $this->type('subject', $subject); //click on save $this->click('_qf_ScheduleReminders_next-bottom'); $this->waitForPageToLoad($this->getTimeoutMsec()); $this->click("//div[@id='reminder']//div[@class='dataTables_wrapper']/table/tbody//tr/td[1][text()='{$title}']/../td[7]/span/a[text()='Edit']"); $this->waitForElementPresent('_qf_ScheduleReminders_cancel-bottom'); $this->assertEquals($title, $this->getValue('id=title')); $this->removeSelection('entity_1', 'label=Meeting'); $this->addSelection('entity_1', 'label=Phone Call'); $this->addSelection('entity_1', 'label=Interview'); $this->removeSelection('entity_2', 'label=Completed'); $this->addSelection('entity_2', 'label=Scheduled'); $this->addSelection('entity_2', 'label=Completed'); $this->assertEquals('1', $this->getSelectedValue('id=start_action_offset')); $this->assertEquals('hour', $this->getSelectedValue('id=start_action_unit')); $this->assertEquals('after', $this->getSelectedValue('id=start_action_condition')); $this->assertEquals('activity_date_time', $this->getSelectedValue('id=start_action_date')); $this->assertChecked('is_repeat'); $this->assertEquals('1', $this->getSelectedValue('id=recipient')); $this->assertChecked('is_active'); } }