1: <?php
2: use Azalea\Selenium\App\ApplicationTestCase;
3: use Azalea\Selenium\App\Patients;
4: use Azalea\Selenium\App\Providers;
5: use Azalea\Selenium\App\Users;
6:
7: class PatentsListTest extends ApplicationTestCase
8: {
9: 10: 11: 12: 13:
14: public function testPatientsListSearch()
15: {
16: $app = $this->login(Users::FELIX_MILLER, Users::PASSWORD);
17:
18: $app->patients->navigate()->verifyAndWait();
19: $app->patients->search->type("search", "Camila Fisher")->press("Search");
20: $this->wait(1);
21:
22: $app->patients->list->grid->waitForModelId(Patients::CAMILA_FISHER_ID)->click();
23: $app->patients->get(Patients::CAMILA_FISHER_ID)->verifyAndWait();
24:
25: $app->patients->navigate()->verifyAndWait();
26: $app->patients->list->filters->reset();
27: $this->spinWait(function() use ($app) {
28: return ($app->patients->list->grid->count() > 1);
29: });
30:
31: $this->assertNoErrorPopups();
32: }
33:
34: 35: 36: 37: 38:
39: public function testPatientsListFiltersSimple()
40: {
41: $app = $this->login(Users::FELIX_MILLER, Users::PASSWORD);
42:
43: $app->patients->navigate()->verifyAndWait();
44:
45: $app->patients->list->filters->byGender("MALE")->go();
46: $this->spinWait(function () use ($app) {
47: $app->patients->list->grid->assertCanNotSee("Female");
48: return true;
49: });
50:
51: $app->patients->list->filters->reset();
52: $this->waitForAjax();
53: $this->spinWait(function () use ($app) {
54: $app->patients->list->grid->assertCanSee("Female");
55: return true;
56: });
57:
58: $app->patients->list->filters->olderThan(18)->go();
59: $this->waitForAjax();
60: $this->spinWait(function () use ($app) {
61: return ($app->patients->list->grid->count() > 0);
62: });
63:
64: $app->patients->list->filters->reset();
65: $this->waitForAjax();
66: $app->patients->list->filters->byStatus("INACTIVE")->go();
67: $this->spinWait(function () use ($app) {
68: $app->patients->list->grid->assertCanNotSee("Active");
69: return true;
70: });
71:
72: $app->patients->list->filters->reset();
73: $this->waitForAjax();
74: $this->spinWait(function () use ($app) {
75: $app->patients->list->grid->assertCanSee("Active");
76: return true;
77: });
78:
79: $app->patients->list->filters->byPrimaryInsurance(121)->go();
80: $this->spinWait(function () use ($app) {
81: $app->patients->list->grid->assertCanNotSee("Self Pay");
82: return true;
83: });
84:
85: $app->patients->list->filters->reset();
86: $this->waitForAjax();
87: $this->spinWait(function () use ($app) {
88: $app->patients->list->grid->assertCanSee("Self Pay");
89: return true;
90: });
91:
92: $app->patients->list->filters->byRenderingProvider(Providers::GROVER_LEDNER_ID)->go();
93: $this->spinWait(function () use ($app) {
94: $app->patients->list->grid->assertCanSee("Grover Ledner");
95: return true;
96: });
97:
98: $app->patients->list->filters->reset();
99:
100: $this->assertNoErrorPopups();
101: }
102:
103: 104: 105: 106: 107:
108: public function testPatientsListFiltersWithExtraColumns()
109: {
110: $app = $this->login(Users::FELIX_MILLER, Users::PASSWORD);
111:
112: $app->patients->navigate()->verifyAndWait();
113:
114:
115: $app->patients->list->columns(array("pat_maritial_status"));
116: $app->patients->list->filters->byMaritalStatus("MARRIED")->go();
117: $this->spinWait(function () use ($app) {
118: $app->patients->list->grid->assertCanNotSee("SINGLE");
119: $app->patients->list->grid->assertCanNotSee("DIVORCED");
120: $app->patients->list->grid->assertCanNotSee("SEPARATED");
121: $app->patients->list->grid->assertCanNotSee("WIDOW");
122: return true;
123: });
124:
125: $app->patients->list->columns(array("pat_maritial_status"));
126: $app->patients->list->filters->reset();
127:
128:
129: $app->patients->list->columns(array("pat_lang_id"));
130: $app->patients->list->filters->byLanguage(57)->go();
131: $this->spinWait(function () use ($app) {
132: $app->patients->list->grid->assertCanNotSee("ENGLISH");
133: return true;
134: });
135:
136: $app->patients->list->columns(array("pat_lang_id"));
137: $app->patients->list->filters->reset();
138:
139:
140: $app->patients->list->columns(array("pat_ethnicity"));
141: $app->patients->list->filters->byEthnicity("HISPANIC OR LATINO")->go();
142: $this->spinWait(function () use ($app) {
143: $app->patients->list->grid->assertCanNotSee("NOT HISPANIC OR LATINO");
144: return true;
145: });
146:
147: $app->patients->list->columns(array("pat_ethnicity"));
148: $app->patients->list->filters->reset();
149:
150: $this->assertNoErrorPopups();
151: }
152:
153: 154: 155: 156: 157: 158:
159: public function testPatientsListFiltersCombined()
160: {
161: $app = $this->login(Users::FELIX_MILLER, Users::PASSWORD);
162:
163: $app->patients->navigate()->verifyAndWait();
164:
165: $app->patients->list->filters->byGender("MALE");
166: $app->patients->list->filters->olderThan(1);
167: $app->patients->list->filters->byPrimaryInsurance(121);
168: $app->patients->list->filters->go();
169:
170: $this->spinWait(function () use ($app) {
171: $app->patients->list->grid->assertCanNotSee("Female");
172: $app->patients->list->grid->assertCanNotSee("Self Pay");
173: return true;
174: });
175:
176: $app->patients->list->filters->reset();
177: $app->patients->list->columns(array("pat_maritial_status"));
178: $app->patients->list->filters->byGender("FEMALE");
179: $app->patients->list->filters->byRenderingProvider(Providers::GROVER_LEDNER_ID);
180: $app->patients->list->filters->byMaritalStatus("DIVORCED");
181: $app->patients->list->filters->go();
182:
183: $this->spinWait(function () use ($app) {
184: $app->patients->list->grid->assertCanNotSee("Male");
185: $app->patients->list->grid->assertCanNotSee("MARRIED");
186: $app->patients->list->grid->assertCanSee("Grover Ledner");
187: return true;
188: });
189:
190: $app->patients->list->columns(array("pat_maritial_status"));
191: $app->patients->list->filters->reset();
192:
193: $this->assertNoErrorPopups();
194: }
195: }
196:
197: ?>