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\Providers;
6: use Azalea\Selenium\App\Users;
7:
8: class ChartInventoryTest extends ApplicationTestCase
9: {
10: public function supportsCustomer($cus_id)
11: {
12:
13: return (Customers::isEhrCustomer($cus_id) || Customers::isEmrCustomer($cus_id));
14: }
15:
16: 17: 18: 19: 20: 21:
22: public function testAddRemoveSimpleImmunizationInventory()
23: {
24: $app = $this->login(Users::FELIX_MILLER, Users::PASSWORD);
25:
26:
27: $chartView = $app->patients->get(Patients::CAMILA_FISHER_ID)->charts->navigate()->addChart();
28:
29:
30: $chartView->procedure->press("Inventory");
31: $this->waitForAjax();
32:
33:
34: $chartView->popups->inventory->verifyAndWait();
35: $chartView->popups->inventory->grid->waitForRowAt(0);
36:
37:
38: $chartView->popups->inventory->type("autoselect_search", "Selenium Test Immunization Simple");
39: $this->spinWait(function () use ($chartView) {
40: return $chartView->popups->inventory->grid->first()->see("Selenium Test Immunization Simple");
41: });
42:
43:
44: $chartView->popups->inventory->grid->waitForRowAt(0)->click();
45: $app->popup->last()->press("Add");
46:
47:
48: $this->waitForAjax();
49: $chartView->popups->patientInventory->verifyAndWait();
50:
51:
52: $chartView->popups->patientInventory->select("pinv_administered_phy_id", Providers::GROVER_LEDNER_ID);
53:
54:
55: $chartView->popups->patientInventory->select("pinv_administered_location_id", 1);
56:
57:
58: $chartView->popups->patientInventory->select("pinv_administered_route_id", 1);
59:
60:
61: $chartView->popups->patientInventory->select("pim_imzs_id", 1);
62:
63:
64: $chartView->popups->patientInventory->setInput("pinv_administered_notes", "This is a note.");
65:
66:
67: $app->popup->last()->press("Submit");
68:
69: 70: 71: 72: 73:
74: $this->spinWait(function () use ($chartView) {
75: $chartView->procedure->inventory->grid->assertCanSee("Selenium Test Immunization Simple");
76: $chartView->procedure->inventory->grid->assertCanSee("Grover Ledner, M.D.");
77: $chartView->procedure->inventory->grid->assertCanSee("Left Thigh");
78: $chartView->procedure->inventory->grid->assertCanSee("Intradermal");
79: $chartView->procedure->inventory->grid->assertCanSee("This is a note.");
80: $chartView->procedure->inventory->grid->assertCanSee("FELIX MILLER");
81: $chartView->procedure->inventory->grid->assertCanSee("ADMINISTRATOR");
82: $chartView->procedure->inventory->grid->assertCanSee("1mL x 1");
83: $chartView->procedure->inventory->grid->assertCanSee("01010");
84: $chartView->procedure->inventory->grid->assertCanSee("12345");
85: $chartView->procedure->inventory->grid->assertCanSee("54321");
86: return true;
87: });
88:
89: 90: 91: 92: 93:
94: $this->spinWait(function () use ($chartView) {
95: $chartView->subjective->immunizations->grid->assertCanSee("Selenium Test Immunization Simple");
96: $chartView->subjective->immunizations->grid->assertCanSee("FELIX MILLER");
97: $chartView->subjective->immunizations->grid->assertCanSee("ADMINISTRATOR");
98: $chartView->subjective->immunizations->grid->assertCanSee("1mL x 1");
99: $chartView->subjective->immunizations->grid->assertCanSee("12345");
100: return true;
101: });
102:
103:
104: $chartView->procedure->inventory->grid->first()->querySelector('[data-button-class="delete"]')->click();
105:
106: 107: 108: 109: 110:
111: $this->spinWait(function () use ($chartView) {
112: $chartView->procedure->inventory->grid->assertCanNotSee("Selenium Test Immunization Simple");
113: return true;
114: });
115:
116:
117: $chartView->subjective->immunizations->grid->first()->querySelector('[data-button-class="delete"]')->click();
118:
119: 120: 121: 122: 123:
124: $this->spinWait(function () use ($chartView) {
125: $chartView->subjective->immunizations->grid->assertCanNotSee("Selenium Test Immunization Simple");
126: return true;
127: });
128:
129:
130: $chartView->cancel();
131:
132: $this->assertNoErrorPopups();
133: }
134:
135: 136: 137: 138:
139: public function testAddRemoveSimpleNonAdministeredInventory()
140: {
141: $app = $this->login(Users::FELIX_MILLER, Users::PASSWORD);
142:
143:
144: $chartView = $app->patients->get(Patients::CAMILA_FISHER_ID)->charts->navigate()->addChart();
145:
146:
147: $chartView->procedure->press("Inventory");
148: $this->waitForAjax();
149:
150:
151: $chartView->popups->inventory->verifyAndWait();
152: $chartView->popups->inventory->grid->waitForRowAt(0);
153:
154:
155: $chartView->popups->inventory->type("autoselect_search", "Selenium Test Non-Administered");
156: $this->spinWait(function () use ($chartView) {
157: return $chartView->popups->inventory->grid->first()->see("Selenium Test Non-Administered");
158: });
159:
160:
161: $chartView->popups->inventory->grid->waitForRowAt(0)->click();
162: $app->popup->last()->press("Add");
163:
164:
165: $chartView->popups->patientInventory->verifyAndWait();
166:
167:
168: $app->popup->last()->press("Submit");
169:
170: 171: 172: 173: 174:
175: $this->spinWait(function () use ($chartView) {
176: $chartView->procedure->inventory->grid->assertCanSee("Selenium Test Non-Administered");
177: $chartView->procedure->inventory->grid->assertCanSee("Selenium Non-Administered Type");
178: $chartView->procedure->inventory->grid->assertCanSee("N/A");
179: $chartView->procedure->inventory->grid->assertCanSee("1 x 1");
180: $chartView->procedure->inventory->grid->assertCanSee("88888");
181: $chartView->procedure->inventory->grid->assertCanSee("99999");
182: return true;
183: });
184:
185:
186: $chartView->procedure->inventory->grid->first()->querySelector('[data-button-class="delete"]')->click();
187:
188: 189: 190: 191: 192:
193: $this->spinWait(function () use ($chartView) {
194: $chartView->procedure->inventory->grid->assertCanNotSee("Selenium Test Non-Administered");
195: return true;
196: });
197:
198:
199: $chartView->cancel();
200:
201: $this->assertNoErrorPopups();
202: }
203:
204: 205: 206: 207:
208: public function testAddRemoveSimpleAdministeredInventory()
209: {
210: $app = $this->login(Users::FELIX_MILLER, Users::PASSWORD);
211:
212:
213: $chartView = $app->patients->get(Patients::CAMILA_FISHER_ID)->charts->navigate()->addChart();
214:
215:
216: $chartView->procedure->press("Inventory");
217: $this->waitForAjax();
218:
219:
220: $chartView->popups->inventory->verifyAndWait();
221: $chartView->popups->inventory->grid->waitForRowAt(0);
222:
223:
224: $chartView->popups->inventory->type("autoselect_search", "Selenium Test Administered");
225: $this->spinWait(function () use ($chartView) {
226: return $chartView->popups->inventory->grid->first()->see("Selenium Test Administered");
227: });
228:
229:
230: $chartView->popups->inventory->grid->waitForRowAt(0)->click();
231: $app->popup->last()->press("Add");
232:
233:
234: $chartView->popups->patientInventory->verifyAndWait();
235:
236:
237: $chartView->popups->patientInventory->press("Now");
238:
239:
240: $chartView->popups->patientInventory->select("pinv_administered_phy_id", Providers::GROVER_LEDNER_ID);
241:
242:
243: $chartView->popups->patientInventory->select("pinv_administered_location_id", 1);
244:
245:
246: $chartView->popups->patientInventory->select("pinv_administered_route_id", 1);
247:
248:
249: $chartView->popups->patientInventory->setInput("pinv_administered_notes", "This is a note.");
250:
251:
252: $app->popup->last()->press("Submit");
253:
254: 255: 256: 257: 258:
259: $this->spinWait(function () use ($chartView) {
260: $chartView->procedure->inventory->grid->assertCanSee("Selenium Test Administered");
261: $chartView->procedure->inventory->grid->assertCanSee("Selenium Administered Type");
262: $chartView->procedure->inventory->grid->assertCanSee("Grover Ledner, M.D.");
263: $chartView->procedure->inventory->grid->assertCanSee("Left Thigh");
264: $chartView->procedure->inventory->grid->assertCanSee("Intradermal");
265: $chartView->procedure->inventory->grid->assertCanSee("This is a note.");
266: $chartView->procedure->inventory->grid->assertCanSee("FELIX MILLER");
267: $chartView->procedure->inventory->grid->assertCanSee("ADMINISTRATOR");
268: $chartView->procedure->inventory->grid->assertCanSee("1mL x 1");
269: $chartView->procedure->inventory->grid->assertCanSee("808080");
270: $chartView->procedure->inventory->grid->assertCanSee("424242");
271: $chartView->procedure->inventory->grid->assertCanSee("242424");
272: return true;
273: });
274:
275:
276: $chartView->procedure->inventory->grid->first()->querySelector('[data-button-class="delete"]')->click();
277:
278: 279: 280: 281: 282:
283: $this->spinWait(function () use ($chartView) {
284: $chartView->procedure->inventory->grid->assertCanNotSee("Selenium Test Administered");
285: return true;
286: });
287:
288:
289: $chartView->cancel();
290:
291: $this->assertNoErrorPopups();
292: }
293:
294: 295: 296: 297: 298:
299: public function testIncrementDecrementInventory()
300: {
301: $app = $this->login(Users::FELIX_MILLER, Users::PASSWORD);
302:
303:
304: $chartView = $app->patients->get(Patients::CAMILA_FISHER_ID)->charts->navigate()->addChart();
305:
306:
307: $chartView->procedure->press("Inventory");
308: $this->waitForAjax();
309:
310:
311: $chartView->popups->inventory->verifyAndWait();
312: $chartView->popups->inventory->grid->waitForRowAt(0);
313:
314:
315: $chartView->popups->inventory->type("autoselect_search", "Selenium Increment Decrement Test");
316: $this->spinWait(function () use ($chartView) {
317: return $chartView->popups->inventory->grid->first()->see("Selenium Increment Decrement Test");
318: });
319:
320:
321: $displayInitialAvailable = $chartView->popups->inventory->grid->first()->querySelector(".displayAvailable")->text();
322: $displayInitialAvailable = str_replace(",", "", trim(current(explode("/", $displayInitialAvailable))));
323: $displayInitialAvailable = intval($displayInitialAvailable);
324:
325:
326: $chartView->popups->inventory->grid->waitForRowAt(0)->click();
327: $app->popup->last()->press("Add");
328:
329:
330: $chartView->popups->patientInventory->verifyAndWait();
331:
332:
333: $app->popup->last()->press("Submit");
334:
335: 336: 337: 338: 339:
340: $this->spinWait(function () use ($chartView) {
341: $chartView->procedure->inventory->grid->assertCanSee("Selenium Increment Decrement Test");
342: return true;
343: });
344:
345:
346:
347: $chartView->procedure->press("Inventory");
348: $this->waitForAjax();
349:
350:
351: $chartView->popups->inventory->verifyAndWait();
352: $chartView->popups->inventory->grid->waitForRowAt(0);
353:
354:
355: $chartView->popups->inventory->type("autoselect_search", "Selenium Increment Decrement Test");
356: $this->spinWait(function () use ($chartView) {
357: return $chartView->popups->inventory->grid->first()->see("Selenium Increment Decrement Test");
358: });
359:
360:
361: $displayAvailable = $chartView->popups->inventory->grid->first()->querySelector(".displayAvailable")->text();
362: $displayAvailable = str_replace(",", "", trim(current(explode("/", $displayAvailable))));
363: $displayAvailable = intval($displayAvailable);
364:
365: $app->popup->last()->press("Cancel");
366:
367:
368: $this->assertTrue($displayAvailable < $displayInitialAvailable);
369:
370:
371:
372: $chartView->procedure->inventory->grid->first()->querySelector('[data-button-class="delete"]')->click();
373:
374: 375: 376: 377: 378:
379: $this->spinWait(function () use ($chartView) {
380: $chartView->procedure->inventory->grid->assertCanNotSee("Selenium Increment Decrement Test");
381: return true;
382: });
383:
384:
385:
386: $chartView->procedure->press("Inventory");
387: $this->waitForAjax();
388:
389:
390: $chartView->popups->inventory->verifyAndWait();
391: $chartView->popups->inventory->grid->waitForRowAt(0);
392:
393:
394: $chartView->popups->inventory->type("autoselect_search", "Selenium Increment Decrement Test");
395: $this->spinWait(function () use ($chartView) {
396: return $chartView->popups->inventory->grid->first()->see("Selenium Increment Decrement Test");
397: });
398:
399:
400: $displayAvailable = $chartView->popups->inventory->grid->first()->querySelector(".displayAvailable")->text();
401: $displayAvailable = str_replace(",", "", trim(current(explode("/", $displayAvailable))));
402: $displayAvailable = intval($displayAvailable);
403:
404: $app->popup->last()->press("Cancel");
405:
406:
407: $this->assertTrue($displayAvailable >= $displayInitialAvailable);
408:
409:
410:
411: $chartView->cancel();
412:
413: $this->assertNoErrorPopups();
414: }
415:
416: 417: 418: 419: 420:
421: public function testIncrementDecrementInventoryWithMultipleUnits()
422: {
423: $app = $this->login(Users::FELIX_MILLER, Users::PASSWORD);
424:
425:
426: $chartView = $app->patients->get(Patients::CAMILA_FISHER_ID)->charts->navigate()->addChart();
427:
428:
429: $chartView->procedure->press("Inventory");
430: $this->waitForAjax();
431:
432:
433: $chartView->popups->inventory->verifyAndWait();
434: $chartView->popups->inventory->grid->waitForRowAt(0);
435:
436:
437: $chartView->popups->inventory->type("autoselect_search", "Selenium Increment Decrement Administered Test");
438: $this->spinWait(function () use ($chartView) {
439: return $chartView->popups->inventory->grid->first()->see("Selenium Increment Decrement Administered Test");
440: });
441:
442:
443: $this->wait(1);
444: $chartView->popups->inventory->grid->clearCache();
445: $displayInitialAvailable = $chartView->popups->inventory->grid->first()->querySelector(".displayAvailable")->text();
446: $displayInitialAvailable = str_replace(",", "", trim(current(explode("/", $displayInitialAvailable))));
447: $displayInitialAvailable = intval($displayInitialAvailable);
448:
449:
450: $chartView->popups->inventory->grid->waitForRowAt(0)->click();
451: $app->popup->last()->press("Add");
452:
453:
454: $chartView->popups->patientInventory->verifyAndWait();
455:
456:
457: $chartView->popups->patientInventory->setInput("pinv_administered_multiplier", 2);
458:
459:
460: $app->popup->last()->press("Submit");
461:
462: 463: 464: 465: 466:
467: $this->spinWait(function () use ($chartView) {
468: $chartView->procedure->inventory->grid->assertCanSee("Selenium Increment Decrement Administered Test");
469: return true;
470: });
471:
472:
473:
474: $chartView->procedure->press("Inventory");
475: $this->waitForAjax();
476:
477:
478: $chartView->popups->inventory->verifyAndWait();
479: $chartView->popups->inventory->grid->waitForRowAt(0);
480:
481:
482: $chartView->popups->inventory->type("autoselect_search", "Selenium Increment Decrement Administered Test");
483: $this->spinWait(function () use ($chartView) {
484: return $chartView->popups->inventory->grid->first()->see("Selenium Increment Decrement Administered Test");
485: });
486:
487:
488: $this->wait(1);
489: $chartView->popups->inventory->grid->clearCache();
490: $displayAvailable = $chartView->popups->inventory->grid->first()->querySelector(".displayAvailable")->text();
491: $displayAvailable = str_replace(",", "", trim(current(explode("/", $displayAvailable))));
492: $displayAvailable = intval($displayAvailable);
493:
494: $app->popup->last()->press("Cancel");
495:
496:
497: $this->assertTrue($displayAvailable == ($displayInitialAvailable - 2));
498:
499:
500:
501: $chartView->procedure->inventory->grid->first()->querySelector('[data-button-class="delete"]')->click();
502:
503: 504: 505: 506: 507:
508: $this->spinWait(function () use ($chartView) {
509: $chartView->procedure->inventory->grid->assertCanNotSee("Selenium Increment Decrement Administered Test");
510: return true;
511: });
512:
513:
514:
515: $chartView->procedure->press("Inventory");
516: $this->waitForAjax();
517:
518:
519: $chartView->popups->inventory->verifyAndWait();
520: $chartView->popups->inventory->grid->waitForRowAt(0);
521:
522:
523: $chartView->popups->inventory->type("autoselect_search", "Selenium Increment Decrement Administered Test");
524: $this->spinWait(function () use ($chartView) {
525: return $chartView->popups->inventory->grid->first()->see("Selenium Increment Decrement Administered Test");
526: });
527:
528:
529: $this->wait(1);
530: $chartView->popups->inventory->grid->clearCache();
531: $displayAvailable = $chartView->popups->inventory->grid->first()->querySelector(".displayAvailable")->text();
532: $displayAvailable = str_replace(",", "", trim(current(explode("/", $displayAvailable))));
533: $displayAvailable = intval($displayAvailable);
534:
535: $app->popup->last()->press("Cancel");
536:
537:
538: $this->assertTrue($displayAvailable == $displayInitialAvailable);
539:
540:
541:
542: $chartView->cancel();
543:
544: $this->assertNoErrorPopups();
545: }
546:
547: 548: 549: 550:
551: public function testAddSingleAttachedCodesInventory()
552: {
553: $app = $this->login(Users::FELIX_MILLER, Users::PASSWORD);
554:
555:
556: $chartView = $app->patients->get(Patients::MABLE_D_CARROLL)->charts->navigate()->addChart();
557:
558:
559: $chartView->setDateOfService(date("Ymd", time()))
560: ->select("enc_spl_id", "9")
561: ->tab();
562:
563:
564: $chartView->procedure->press("Inventory");
565: $this->waitForAjax();
566:
567:
568: $chartView->popups->inventory->verifyAndWait();
569: $chartView->popups->inventory->grid->waitForRowAt(0);
570:
571:
572: $chartView->popups->inventory->type("autoselect_search", "Selenium Test Single Attached Codes");
573: $this->spinWait(function () use ($chartView) {
574: return $chartView->popups->inventory->grid->first()->see("Selenium Test Single Attached Codes");
575: });
576:
577:
578: $chartView->popups->inventory->grid->waitForRowAt(0)->click();
579: $app->popup->last()->press("Add");
580:
581:
582: $chartView->popups->patientInventory->verifyAndWait();
583:
584:
585: $app->popup->last()->press("Submit");
586:
587: 588: 589: 590: 591:
592: $this->spinWait(function () use ($chartView) {
593: $chartView->procedure->inventory->grid->assertCanSee("Selenium Test Single Attached Codes");
594: return true;
595: });
596:
597: 598: 599: 600:
601: $this->spinWait(function () use ($chartView) {
602: $chartView->procedures->grid->assertCanSee("J6040");
603: return true;
604: });
605:
606: 607: 608: 609:
610: $this->spinWait(function () use ($chartView) {
611: $chartView->icds->grid->assertCanSee("I10");
612: return true;
613: });
614:
615:
616: $chartView->procedure->inventory->grid->first()->querySelector('[data-button-class="delete"]')->click();
617:
618:
619: $chartView->icds->grid->first()->querySelector('[data-button-class="Delete"]')->click();
620:
621:
622: $chartView->procedures->removeAll();
623:
624:
625: $chartView->cancel();
626:
627: $this->assertNoErrorPopups();
628: }
629:
630: 631: 632: 633: 634:
635: public function testAddSingleAttachedCodesInventoryWithDefaultUnitCount()
636: {
637: $app = $this->login(Users::FELIX_MILLER, Users::PASSWORD);
638:
639:
640: $chartView = $app->patients->get(Patients::CAMILA_FISHER_ID)->charts->navigate()->addChart();
641:
642:
643: $chartView->setDateOfService(date("Ymd", time()))
644: ->select("enc_spl_id", "9")
645: ->tab();
646:
647:
648: $chartView->procedure->press("Inventory");
649: $this->waitForAjax();
650:
651:
652: $chartView->popups->inventory->verifyAndWait();
653: $chartView->popups->inventory->grid->waitForRowAt(0);
654:
655:
656: $chartView->popups->inventory->type("autoselect_search", "Dexamethasone Sodium Phosphate");
657: $this->spinWait(function () use ($chartView) {
658: return $chartView->popups->inventory->grid->first()->see("Dexamethasone Sodium Phosphate");
659: });
660:
661:
662: $chartView->popups->inventory->grid->waitForRowAt(0)->click();
663: $app->popup->last()->press("Add");
664:
665:
666: $chartView->popups->patientInventory->verifyAndWait();
667:
668: 669: 670: 671:
672: $chartView->popups->patientInventory->assertInputValueEquals("J1100", "1");
673:
674:
675: $app->popup->last()->press("Submit");
676:
677: 678: 679: 680: 681:
682: $this->spinWait(function () use ($chartView) {
683: $chartView->procedure->inventory->grid->assertCanSee("Dexamethasone Sodium Phosphate");
684: return true;
685: });
686:
687: 688: 689: 690: 691: 692:
693: $this->spinWait(function () use ($chartView) {
694: $chartView->procedures->grid->assertCanSee("J1100");
695: $chartView->procedures->grid->first()->filter(".ecp_num_units")->assertCanSee("1");
696: $chartView->procedure->inventory->assertCanSee("1mg x 1");
697: return true;
698: });
699:
700:
701: $chartView->procedure->inventory->grid->first()->querySelector('[data-button-class="delete"]')->click();
702:
703:
704: $chartView->procedures->removeAll();
705:
706:
707: $chartView->cancel();
708:
709: $this->assertNoErrorPopups();
710: }
711:
712: 713: 714: 715: 716:
717: public function testAddSingleAttachedCodesInventoryWithMultipleUnits()
718: {
719: $app = $this->login(Users::FELIX_MILLER, Users::PASSWORD);
720:
721:
722: $chartView = $app->patients->get(Patients::CAMILA_FISHER_ID)->charts->navigate()->addChart();
723:
724:
725: $chartView->setDateOfService(date("Ymd", time()))
726: ->select("enc_spl_id", "9")
727: ->tab();
728:
729:
730: $chartView->procedure->press("Inventory");
731: $this->waitForAjax();
732:
733:
734: $chartView->popups->inventory->verifyAndWait();
735: $chartView->popups->inventory->grid->waitForRowAt(0);
736:
737:
738: $chartView->popups->inventory->type("autoselect_search", "Selenium Test Single Attached Codes Multiple Units");
739: $this->spinWait(function () use ($chartView) {
740: return $chartView->popups->inventory->grid->first()->see("Selenium Test Single Attached Codes Multiple Units");
741: });
742:
743:
744: $chartView->popups->inventory->grid->waitForRowAt(0)->click();
745: $app->popup->last()->press("Add");
746:
747:
748: $chartView->popups->patientInventory->verifyAndWait();
749:
750:
751: $chartView->popups->patientInventory->setInput("pinv_administered_multiplier", 2);
752:
753: 754: 755: 756:
757: $chartView->popups->patientInventory->assertInputValueEquals("J0980", "60");
758:
759:
760: $app->popup->last()->press("Submit");
761:
762: 763: 764: 765: 766:
767: $this->spinWait(function () use ($chartView) {
768: $chartView->procedure->inventory->grid->assertCanSee("Selenium Test Single Attached Codes Multiple Units");
769: return true;
770: });
771:
772: 773: 774: 775: 776: 777:
778: $this->spinWait(function () use ($chartView) {
779: $chartView->procedures->grid->assertCanSee("J0980");
780: $chartView->procedures->grid->first()->filter(".ecp_num_units")->assertCanSee("60");
781: $chartView->procedure->inventory->assertCanSee("60mg x 2");
782: return true;
783: });
784:
785:
786: $chartView->procedure->inventory->grid->first()->querySelector('[data-button-class="delete"]')->click();
787:
788:
789: $chartView->procedures->removeAll();
790:
791:
792: $chartView->cancel();
793:
794: $this->assertNoErrorPopups();
795: }
796:
797: 798: 799: 800: 801:
802: public function testCanOverrideAttachedCptUnitCount()
803: {
804: $app = $this->login(Users::FELIX_MILLER, Users::PASSWORD);
805:
806:
807: $chartView = $app->patients->get(Patients::CAMILA_FISHER_ID)->charts->navigate()->addChart();
808:
809:
810: $chartView->setDateOfService(date("Ymd", time()))
811: ->select("enc_spl_id", "9")
812: ->tab();
813:
814:
815: $chartView->procedure->press("Inventory");
816: $this->waitForAjax();
817:
818:
819: $chartView->popups->inventory->verifyAndWait();
820: $chartView->popups->inventory->grid->waitForRowAt(0);
821:
822:
823: $chartView->popups->inventory->type("autoselect_search", "Selenium Test Single Attached Codes Multiple Units");
824: $this->spinWait(function () use ($chartView) {
825: return $chartView->popups->inventory->grid->first()->see("Selenium Test Single Attached Codes Multiple Units");
826: });
827:
828:
829: $chartView->popups->inventory->grid->waitForRowAt(0)->click();
830: $app->popup->last()->press("Add");
831:
832:
833: $chartView->popups->patientInventory->verifyAndWait();
834:
835: 836: 837: 838:
839: $chartView->popups->patientInventory->assertInputValueEquals("J0980", "60");
840:
841:
842: $chartView->popups->patientInventory->setInput("J0980", 30);
843:
844:
845: $app->popup->last()->press("Submit");
846:
847: 848: 849: 850: 851:
852: $this->spinWait(function () use ($chartView) {
853: $chartView->procedure->inventory->grid->assertCanSee("Selenium Test Single Attached Codes Multiple Units");
854: return true;
855: });
856:
857: 858: 859: 860: 861: 862:
863: $this->spinWait(function () use ($chartView) {
864: $chartView->procedures->grid->assertCanSee("J0980");
865: $chartView->procedures->grid->first()->filter(".ecp_num_units")->assertCanSee("30");
866: $chartView->procedure->inventory->assertCanSee("60mg x 1");
867: return true;
868: });
869:
870:
871: $chartView->procedure->inventory->grid->first()->querySelector('[data-button-class="delete"]')->click();
872:
873:
874: $chartView->procedures->removeAll();
875:
876:
877: $chartView->cancel();
878:
879: $this->assertNoErrorPopups();
880: }
881: }
882:
883: ?>