1: <?php
2: use Azalea\Selenium\App\ApplicationTestCase;
3: use Azalea\Selenium\App\Customers;
4: use Azalea\Selenium\App\Patients;
5: use Azalea\Selenium\App\Users;
6:
7: class PatientCommentsTest extends ApplicationTestCase
8: {
9: 10: 11: 12: 13: 14:
15: public function testCanAddAndRemovePatientComments()
16: {
17: $app = $this->login(Users::FELIX_MILLER, Users::PASSWORD);
18:
19:
20: $patientView = $app->patients->open(Patients::COMMENT_ADD_REMOVE);
21:
22:
23: $patientComments = $patientView->comments->navigate()->verifyAndWait();
24:
25:
26: $this->waitForAjax();
27: $app->popup->closeAll();
28:
29:
30: $patientComments->controls->press("New Comment");
31:
32: 33: 34: 35:
36: $this->spinWait(function() use ($patientComments) {
37: $patientComments->assertElementVisible("#note_field");
38: return true;
39: });
40:
41:
42: $contents = "This is a comment ".time();
43: $patientComments->comments->type("note_field", $contents);
44:
45:
46: $patientComments->comments->press("Submit");
47:
48: 49: 50: 51:
52: $this->spinWait(function() use ($patientComments, $contents) {
53: $patientComments->comments->grid->assertCanSee($contents);
54: return true;
55: });
56:
57:
58: $patientComments->comments->grid->first()->querySelector(".delete")->click();
59:
60: 61: 62: 63:
64: $this->spinWait(function() use ($patientComments, $contents) {
65: $patientComments->comments->grid->assertCanNotSee($contents);
66: return true;
67: });
68: }
69: }
70:
71: ?>