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 PatientDashboardAlertsTest extends ApplicationTestCase
8: {
9: 10: 11: 12: 13: 14: 15:
16: public function testDisplaysCoPayAsDollarOrPercent()
17: {
18: $app = $this->login(Users::FELIX_MILLER, Users::PASSWORD);
19:
20:
21: $patientView = $app->patients->open(Patients::INSURANCE_COPAY_TEST);
22:
23:
24: $patientInsurance = $patientView->insurance->navigate()->verifyAndWait();
25:
26:
27: $this->waitForAjax();
28: $app->popup->closeAll();
29:
30: $patientInsurance->grid->waitForRowAt(0);
31:
32:
33: $patientInsurance->grid->at(0)->querySelector('[data-button-class="edit"]')->click();
34:
35:
36: $form = $this->getView("patients/add-insurance-popup-form.json")->verifyAndWait();
37: $form->setInput(array(
38: "pat_ins_copay" => "$25.00"
39: ))->tab();
40:
41:
42: $app->popup->last()->press("Save");
43:
44: $this->waitForAjax();
45:
46:
47: $patientDash = $patientView->dashboard->navigate()->verifyAndWait();
48:
49: 50: 51: 52: 53:
54: $this->spinWait(function () use ($patientDash) {
55: $patientDash->balanceAlerts->assertCanSee("Patient has a copay of $25.00");
56: return true;
57: });
58:
59:
60: $patientInsurance = $patientView->insurance->navigate()->verifyAndWait();
61:
62: $patientInsurance->grid->waitForRowAt(0);
63:
64:
65: $patientInsurance->grid->at(0)->querySelector('[data-button-class="edit"]')->click();
66:
67:
68: $form = $this->getView("patients/add-insurance-popup-form.json")->verifyAndWait();
69: $form->setInput(array(
70: "pat_ins_copay" => "25%"
71: ))->tab();
72:
73:
74: $app->popup->last()->press("Save");
75:
76: $this->waitForAjax();
77:
78:
79: $patientDash = $patientView->dashboard->navigate()->verifyAndWait();
80:
81: 82: 83: 84: 85:
86: $this->spinWait(function () use ($patientDash) {
87: $patientDash->balanceAlerts->assertCanSee("Patient has a copay of 25%");
88: return true;
89: });
90: }
91:
92: 93: 94: 95: 96: 97: 98:
99: public function testPatientBalanceAlertTest1()
100: {
101: if (!Customers::isEhrCustomer($this->getCustomerId()) && !Customers::isPmCustomer($this->getCustomerId())) {
102: return $this->skip();
103: }
104:
105: $app = $this->login(Users::FELIX_MILLER, Users::PASSWORD);
106:
107:
108: $patientView = $app->patients->open(Patients::PATIENT_BALANCE_TEST1);
109:
110:
111: $patientDash = $patientView->dashboard->navigate()->verifyAndWait();
112:
113: 114: 115: 116: 117:
118: $this->waitForAjax();
119: $this->spinWait(function () use ($patientDash) {
120: $patientDash->balanceAlerts->assertCanNotSee("Calculating account balances for this patient...");
121: $patientDash->balanceAlerts->assertCanNotSee("Patient has a patient balance");
122: return true;
123: });
124: }
125:
126: 127: 128: 129: 130: 131: 132:
133: public function testPatientBalanceAlertTest2()
134: {
135: if (!Customers::isEhrCustomer($this->getCustomerId()) && !Customers::isPmCustomer($this->getCustomerId())) {
136: return $this->skip();
137: }
138:
139: $app = $this->login(Users::FELIX_MILLER, Users::PASSWORD);
140:
141:
142: $patientView = $app->patients->open(Patients::PATIENT_BALANCE_TEST2);
143:
144:
145: $patientDash = $patientView->dashboard->navigate()->verifyAndWait();
146:
147: 148: 149: 150: 151:
152: $this->waitForAjax();
153: $this->spinWait(function () use ($patientDash) {
154: $patientDash->balanceAlerts->assertCanNotSee("Calculating account balances for this patient...");
155: $patientDash->balanceAlerts->assertCanSee("Patient has a patient balance of $151.83");
156: return true;
157: });
158: }
159:
160: 161: 162: 163: 164: 165: 166: 167:
168: public function testPatientBalanceAlertTest3()
169: {
170: if (!Customers::isEhrCustomer($this->getCustomerId()) && !Customers::isPmCustomer($this->getCustomerId())) {
171: return $this->skip();
172: }
173:
174: $app = $this->login(Users::FELIX_MILLER, Users::PASSWORD);
175:
176:
177: $patientView = $app->patients->open(Patients::PATIENT_BALANCE_TEST3);
178:
179:
180: $patientDash = $patientView->dashboard->navigate()->verifyAndWait();
181:
182: 183: 184: 185: 186:
187: $this->waitForAjax();
188: $this->spinWait(function () use ($patientDash) {
189: $patientDash->balanceAlerts->assertCanNotSee("Calculating account balances for this patient...");
190: $patientDash->balanceAlerts->assertCanSee("Patient has a patient balance of $1,277.89");
191: return true;
192: });
193: }
194:
195: 196: 197: 198: 199: 200: 201:
202: public function testPatientBalanceAlertTest4()
203: {
204: if (!Customers::isEhrCustomer($this->getCustomerId()) && !Customers::isPmCustomer($this->getCustomerId())) {
205: return $this->skip();
206: }
207:
208: $app = $this->login(Users::FELIX_MILLER, Users::PASSWORD);
209:
210:
211: $patientView = $app->patients->open(Patients::PATIENT_BALANCE_TEST4);
212:
213:
214: $patientDash = $patientView->dashboard->navigate()->verifyAndWait();
215:
216: 217: 218: 219: 220:
221: $this->waitForAjax();
222: $this->spinWait(function () use ($patientDash) {
223: $patientDash->balanceAlerts->assertCanNotSee("Calculating account balances for this patient...");
224: $patientDash->balanceAlerts->assertCanSee("Patient has a patient balance of $1,398.28");
225: return true;
226: });
227: }
228:
229: 230: 231: 232: 233: 234: 235:
236: public function testPatientBalanceAlertTest5()
237: {
238: if (!Customers::isEhrCustomer($this->getCustomerId()) && !Customers::isPmCustomer($this->getCustomerId())) {
239: return $this->skip();
240: }
241:
242: $app = $this->login(Users::FELIX_MILLER, Users::PASSWORD);
243:
244:
245: $patientView = $app->patients->open(Patients::PATIENT_BALANCE_TEST5);
246:
247:
248: $patientDash = $patientView->dashboard->navigate()->verifyAndWait();
249:
250: 251: 252: 253: 254:
255: $this->waitForAjax();
256: $this->spinWait(function () use ($patientDash) {
257: $patientDash->balanceAlerts->assertCanNotSee("Calculating account balances for this patient...");
258: $patientDash->balanceAlerts->assertCanSee("Patient has a patient balance of $977.39");
259: return true;
260: });
261: }
262:
263: 264: 265: 266: 267: 268: 269: 270:
271: public function testPatientBalanceAlertTest6()
272: {
273: if (!Customers::isEhrCustomer($this->getCustomerId()) && !Customers::isPmCustomer($this->getCustomerId())) {
274: return $this->skip();
275: }
276:
277: $app = $this->login(Users::FELIX_MILLER, Users::PASSWORD);
278:
279:
280: $patientView = $app->patients->open(Patients::PATIENT_BALANCE_TEST6);
281:
282:
283: $patientDash = $patientView->dashboard->navigate()->verifyAndWait();
284:
285: 286: 287: 288: 289:
290: $this->waitForAjax();
291: $this->spinWait(function () use ($patientDash) {
292: $patientDash->balanceAlerts->assertCanNotSee("Calculating account balances for this patient...");
293: $patientDash->balanceAlerts->assertCanSee("Patient has a patient balance of $586.99");
294: return true;
295: });
296: }
297:
298: 299: 300: 301: 302: 303: 304: 305: 306: 307:
308: public function testPatientMultipleBalanceTest1()
309: {
310: if (!Customers::isEhrCustomer($this->getCustomerId()) && !Customers::isPmCustomer($this->getCustomerId())) {
311: return $this->skip();
312: }
313:
314: $app = $this->login(Users::FELIX_MILLER, Users::PASSWORD);
315:
316:
317: $patientView = $app->patients->open(Patients::PATIENT_MULTI_BALANCE_TEST1);
318:
319:
320: $patientDash = $patientView->dashboard->navigate()->verifyAndWait();
321:
322: 323: 324: 325: 326: 327:
328: $this->waitForAjax();
329: $this->spinWait(function () use ($patientDash) {
330: $patientDash->balanceAlerts->assertCanNotSee("Calculating account balances for this patient...");
331: $patientDash->balanceAlerts->assertCanSee("Patient has a patient balance of $120.72");
332: $patientDash->balanceAlerts->assertCanSee("Patient has an insurance balance of $48.56");
333: return true;
334: });
335: }
336:
337: 338: 339: 340: 341: 342: 343: 344:
345: public function testPrimaryInsuranceBalanceAlertTest1()
346: {
347: if (!Customers::isEhrCustomer($this->getCustomerId()) && !Customers::isPmCustomer($this->getCustomerId())) {
348: return $this->skip();
349: }
350:
351: $app = $this->login(Users::FELIX_MILLER, Users::PASSWORD);
352:
353:
354: $patientView = $app->patients->open(Patients::PRI_INS_BALANCE_TEST1);
355:
356:
357: $patientDash = $patientView->dashboard->navigate()->verifyAndWait();
358:
359: 360: 361: 362: 363:
364: $this->waitForAjax();
365: $this->spinWait(function () use ($patientDash) {
366: $patientDash->balanceAlerts->assertCanNotSee("Calculating account balances for this patient...");
367: $patientDash->balanceAlerts->assertCanNotSee("Patient has an insurance balance");
368: return true;
369: });
370: }
371:
372: 373: 374: 375: 376: 377: 378: 379:
380: public function testPrimaryInsuranceBalanceAlertTest2()
381: {
382: if (!Customers::isEhrCustomer($this->getCustomerId()) && !Customers::isPmCustomer($this->getCustomerId())) {
383: return $this->skip();
384: }
385:
386: $app = $this->login(Users::FELIX_MILLER, Users::PASSWORD);
387:
388:
389: $patientView = $app->patients->open(Patients::PRI_INS_BALANCE_TEST2);
390:
391:
392: $patientDash = $patientView->dashboard->navigate()->verifyAndWait();
393:
394: 395: 396: 397: 398:
399: $this->waitForAjax();
400: $this->spinWait(function () use ($patientDash) {
401: $patientDash->balanceAlerts->assertCanNotSee("Calculating account balances for this patient...");
402: $patientDash->balanceAlerts->assertCanSee("Patient has an insurance balance of $148.56");
403: return true;
404: });
405: }
406:
407: 408: 409: 410: 411: 412: 413: 414:
415: public function testPrimaryInsuranceBalanceAlertTest3()
416: {
417: if (!Customers::isEhrCustomer($this->getCustomerId()) && !Customers::isPmCustomer($this->getCustomerId())) {
418: return $this->skip();
419: }
420:
421: $app = $this->login(Users::FELIX_MILLER, Users::PASSWORD);
422:
423:
424: $patientView = $app->patients->open(Patients::PRI_INS_BALANCE_TEST3);
425:
426:
427: $patientDash = $patientView->dashboard->navigate()->verifyAndWait();
428:
429: 430: 431: 432: 433:
434: $this->waitForAjax();
435: $this->spinWait(function () use ($patientDash) {
436: $patientDash->balanceAlerts->assertCanNotSee("Calculating account balances for this patient...");
437: $patientDash->balanceAlerts->assertCanSee("Patient has an insurance balance of $1,367.64");
438: return true;
439: });
440: }
441:
442: 443: 444: 445: 446: 447: 448: 449: 450:
451: public function testPatientGuarantorBalanceAlertTest1()
452: {
453: if (!Customers::isEhrCustomer($this->getCustomerId()) && !Customers::isPmCustomer($this->getCustomerId())) {
454: return $this->skip();
455: }
456:
457: $app = $this->login(Users::FELIX_MILLER, Users::PASSWORD);
458:
459:
460: $patientView = $app->patients->open(Patients::PHYLLIS_ARMSTRONG);
461:
462:
463: $patientDash = $patientView->dashboard->navigate()->verifyAndWait();
464:
465: 466: 467: 468: 469:
470: $this->waitForAjax();
471: $this->spinWait(function () use ($patientDash) {
472: $patientDash->balanceAlerts->assertCanNotSee("Calculating account balances for this patient...");
473: $patientDash->balanceAlerts->assertCanSee("Patient has a patient balance of $70.72");
474: return true;
475: });
476:
477:
478: $patientView = $app->patients->open(Patients::APRIL_ARMSTRONG);
479:
480:
481: $patientDash = $patientView->dashboard->navigate()->verifyAndWait();
482:
483: 484: 485: 486: 487: 488:
489: $this->waitForAjax();
490: $this->spinWait(function () use ($patientDash) {
491: $patientDash->balanceAlerts->assertCanNotSee("Calculating account balances for this patient...");
492: $patientDash->balanceAlerts->assertCanSee("Patient has an insurance balance of $798.36");
493: $patientDash->balanceAlerts->assertCanSee("Patient's guarantor");
494: $patientDash->balanceAlerts->assertCanSee("Armstrong, Phyllis");
495: $patientDash->balanceAlerts->assertCanSee("has a balance of $70.72");
496: return true;
497: });
498: }
499: }
500:
501: ?>