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 ChartCustomFieldBehaviorsTest extends ApplicationTestCase
8: {
9: public function supportsCustomer($cus_id)
10: {
11:
12: return (Customers::isEhrCustomer($cus_id) || Customers::isEmrCustomer($cus_id));
13: }
14:
15: 16: 17: 18: 19:
20: public function testCustomTextFieldWithDefaultText()
21: {
22: $app = $this->login(Users::FELIX_MILLER, Users::PASSWORD);
23:
24:
25: $chartView = $app->patients->get(Patients::CAMILA_FISHER_ID)->charts->navigate()->addChart();
26:
27:
28: $buttons = $chartView->subjective->removeAllCustomFields($app);
29:
30:
31:
32: $chartView->subjective->addSubjectiveField();
33:
34: $chartView->popups->fields->verifyAndWait();
35: $chartView->popups->fields->grid->waitForRowAt(0);
36:
37:
38: $chartView->popups->fields->type("autoselect_search", "Subjective Text Field with Text");
39: $chartView->popups->fields->grid->waitForRowTextAt(0, "Subjective Text Field with Text");
40:
41:
42: $chartView->popups->fields->grid->waitForRowAt(0)->click();
43:
44: 45: 46: 47: 48:
49:
50: $this->spinWait(function () use ($chartView) {
51: $chartView->subjective->fields->assertCanSee("Subjective Text Field with Text");
52: $chartView->subjective->fields->assertElementExists(".charts-HTMLInputView");
53: return true;
54: });
55:
56: $chartView->subjective->fields->assertCanSee("This is some example text.");
57:
58:
59: $chartView->cancel();
60: }
61:
62: 63: 64: 65:
66: public function testCustomTextFieldAutoAdded()
67: {
68: $app = $this->login(Users::FELIX_MILLER, Users::PASSWORD);
69:
70:
71: $chartView = $app->patients->get(Patients::CAMILA_FISHER_ID)->charts->navigate()->addChart();
72:
73: 74: 75: 76:
77:
78: $this->spinWait(function () use ($chartView) {
79: $chartView->subjective->fields->assertCanSee("Subjective Text Field Auto Add");
80: $chartView->subjective->fields->assertElementExists(".charts-HTMLInputView");
81: return true;
82: });
83:
84:
85: $chartView->cancel();
86: }
87:
88: 89: 90: 91: 92: 93:
94: public function testCustomTextFieldCopyFieldRules()
95: {
96: $app = $this->login(Users::FELIX_MILLER, Users::PASSWORD);
97:
98:
99: $chartView = $app->patients->get(Patients::THORA_BERNIER_ID)->charts->navigate()->addChart();
100:
101:
102: $chartView->setDateOfService(date("Ymd", time()))
103: ->select("enc_spl_id", "9")
104: ->tab();
105:
106:
107: $chartView->subjective->removeAllCustomFields($app);
108:
109:
110:
111: $chartView->subjective->addSubjectiveField();
112:
113: $chartView->popups->fields->verifyAndWait();
114: $chartView->popups->fields->grid->waitForRowAt(0);
115:
116:
117: $chartView->popups->fields->type("autoselect_search", "Subjective Text Field Copy Field");
118: $chartView->popups->fields->grid->waitForRowTextAt(0, "Subjective Text Field Copy Field");
119:
120:
121: $chartView->popups->fields->grid->waitForRowAt(0)->click();
122:
123: 124: 125: 126:
127:
128: $this->spinWait(function () use ($chartView) {
129: $chartView->subjective->fields->assertCanSee("Subjective Text Field Copy Field");
130: $chartView->subjective->fields->assertElementExists(".charts-HTMLInputView");
131: return true;
132: });
133:
134:
135: $chartView->subjective->fields->press("Edit");
136:
137:
138: $this->keys("This is some text to not copy.");
139:
140:
141: $chartView->subjective->fields->press("Save");
142:
143:
144:
145: $chartView->clearCache();
146: $chartView->subjective->addSubjectiveField();
147:
148: $chartView->popups->fields->verifyAndWait();
149: $chartView->popups->fields->grid->waitForRowAt(0);
150:
151:
152: $chartView->popups->fields->type("autoselect_search", "Subjective Text Field with Text Copy Field");
153: $chartView->popups->fields->grid->waitForRowTextAt(0, "Subjective Text Field with Text Copy Field");
154:
155:
156: $chartView->popups->fields->grid->waitForRowAt(0)->click();
157:
158: 159: 160: 161:
162:
163: $this->spinWait(function () use ($chartView) {
164: $chartView->subjective->fields->assertCanSee("Subjective Text Field with Text Copy Field");
165: return true;
166: });
167:
168:
169:
170: $chartView->clearCache();
171: $chartView->subjective->addSubjectiveField();
172:
173: $chartView->popups->fields->verifyAndWait();
174: $chartView->popups->fields->grid->waitForRowAt(0);
175:
176:
177: $chartView->popups->fields->type("autoselect_search", "Subjective Text Field Copy Field Value");
178: $chartView->popups->fields->grid->waitForRowTextAt(0, "Subjective Text Field Copy Field Value");
179:
180:
181: $chartView->popups->fields->grid->waitForRowAt(0)->click();
182:
183: 184: 185: 186:
187:
188: $this->spinWait(function () use ($chartView) {
189: $chartView->subjective->fields->assertCanSee("Subjective Text Field Copy Field Value");
190: $chartView->subjective->fields->assertElementExists(".charts-HTMLInputView");
191: return true;
192: });
193:
194:
195: $chartView->subjective->fields->press("Edit", 2);
196:
197:
198: $this->keys("This is some text to copy.");
199:
200:
201: $chartView->subjective->fields->press("Save");
202:
203:
204: $first_enc_id = $app->charts->getEncounterIdFromHash();
205:
206:
207: $chartView->save();
208:
209:
210: $chartView = $app->patients->get(Patients::THORA_BERNIER_ID)->charts->navigate()->addChart();
211:
212: 213: 214: 215: 216:
217: $this->spinWait(function () use ($chartView) {
218: $chartView->subjective->fields->assertCanSee("Subjective Text Field Copy Field");
219: $chartView->subjective->fields->assertCanNotSee("This is some text to not copy.");
220: $chartView->subjective->fields->assertCanSee("Subjective Text Field with Text Copy Field");
221: $chartView->subjective->fields->assertCanSee("This is some default text for subjective text field copy field.");
222: $chartView->subjective->fields->assertCanSee("Subjective Text Field Copy Field Value");
223: $chartView->subjective->fields->assertCanSee("This is some text to copy.");
224: return true;
225: });
226:
227:
228: $chartView->save();
229: $this->waitForAjax();
230:
231:
232: $chartView->cancel();
233: $this->waitForAjax();
234:
235:
236: $chartView = $app->patients->get(Patients::THORA_BERNIER_ID)->charts->navigate()->edit($first_enc_id);
237:
238:
239: $chartView->cancel();
240: }
241: }
242:
243: ?>