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 PatientPopupCommentsTest extends ApplicationTestCase
8: {
9: 10: 11: 12: 13: 14:
15: public function testCanAddAndRemovePopupComments()
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 Pop up");
31: $popup = $patientComments->popups->popupCommentEdit;
32:
33: 34: 35: 36:
37: $this->spinWait(function() use ($popup) {
38: $popup->assertElementVisible("#ppr_note");
39: return true;
40: });
41:
42:
43: $contents = "This is a popup comment ".time();
44: $popup->type("ppr_note", $contents);
45:
46:
47: $app->popup->last()->press("Submit");
48:
49: 50: 51: 52:
53: $this->spinWait(function() use ($patientComments, $contents) {
54: $patientComments->popupComments->grid->assertCanSee($contents);
55: return true;
56: });
57:
58:
59: $patientComments->popupComments->grid->first()->querySelector(".delete")->click();
60:
61: 62: 63: 64:
65: $this->spinWait(function() use ($patientComments, $contents) {
66: $patientComments->popupComments->grid->assertCanNotSee($contents);
67: return true;
68: });
69: }
70:
71: 72: 73: 74: 75: 76: 77:
78: public function testPopupCommentsAppear()
79: {
80: $app = $this->login(Users::FELIX_MILLER, Users::PASSWORD);
81:
82:
83: $patientView = $app->patients->open(Patients::POPUP_COMMENTS_TEST);
84:
85:
86: $this->waitForAjax();
87:
88: 89: 90: 91: 92: 93: 94: 95: 96:
97: $this->spinWait(function () use ($patientView) {
98: $patientView->popups->popupComments->verifyAndWait();
99: $patientView->popups->popupComments->assertCanSee("This is a Patient View popup comment.");
100: $patientView->popups->popupComments->assertCanSee("This is an All Areas popup comment.");
101: $patientView->popups->popupComments->assertCanNotSee("This is an Encounter popup comment.");
102: $patientView->popups->popupComments->assertCanNotSee("This is an Appointment View popup comment.");
103: return true;
104: });
105:
106:
107: $app->popup->closeAll();
108:
109:
110: $patientView->encounters->edit(362336);
111:
112: 113: 114: 115: 116: 117: 118: 119: 120:
121: $this->spinWait(function () use ($patientView) {
122: $patientView->popups->popupComments->verifyAndWait();
123: $patientView->popups->popupComments->assertCanSee("This is a Patient View popup comment.");
124: $patientView->popups->popupComments->assertCanSee("This is an All Areas popup comment.");
125: $patientView->popups->popupComments->assertCanSee("This is an Encounter popup comment.");
126: $patientView->popups->popupComments->assertCanNotSee("This is an Appointment View popup comment.");
127: return true;
128: });
129:
130:
131: $app->popup->closeAll();
132:
133:
134: $apptView = $patientView->appointments->navigate()->verifyAndWait();
135:
136:
137: $apptView->grid->waitForRowAt(0);
138: $apptView->grid->first()->querySelector(
139: $apptView->selectors->grid->apptView
140: )->click();
141:
142: 143: 144: 145: 146: 147: 148: 149: 150: 151:
152: $this->spinWait(function () use ($patientView) {
153: $patientView->popups->popupComments->verifyAndWait();
154: $patientView->popups->popupComments->assertCanSee("This is a Patient View popup comment.");
155: $patientView->popups->popupComments->assertCanSee("This is an All Areas popup comment.");
156: $patientView->popups->popupComments->assertCanSee("This is an Appointment View popup comment");
157: $patientView->popups->popupComments->assertCanNotSee("This is an Encounter popup comment.");
158: return true;
159: });
160: }
161: }
162:
163: ?>