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 ChartSmokingStatusTest 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: public function testAddRemoveSmokingStatus()
20: {
21: $app = $this->login(Users::FELIX_MILLER, Users::PASSWORD);
22:
23:
24: $chartView = $app->patients->get(Patients::SAMIR_FUNK)->charts->navigate()->addChart();
25:
26:
27: $chartView->subjective->press("Smoking Status");
28: $this->waitForAjax();
29:
30:
31: $popup = $app->popup->last();
32: $popup->waitForElementText(".popup_title_text", "Smoking Status");
33:
34: $today = date("m/d/Y");
35:
36:
37: $popup->select("pss_status", 4);
38:
39:
40: $popup->press("Today");
41:
42:
43:
44: $popup->press("Save");
45: $this->waitForAjax();
46:
47: 48: 49: 50:
51: $this->spinWait(function () use ($chartView, $today) {
52: $chartView->subjective->smoking->assertCanSee("Never smoker");
53: $chartView->subjective->smoking->assertCanSee($today);
54: return true;
55: });
56:
57:
58: $chartView->subjective->smoking->querySelector(".remove")->click();
59:
60: 61: 62: 63:
64: $this->spinWait(function () use ($chartView, $today) {
65: $chartView->subjective->smoking->assertCanNotSee("Never smoker");
66: $chartView->subjective->smoking->assertCanNotSee($today);
67: return true;
68: });
69:
70:
71: $chartView->cancel();
72:
73: $this->assertNoErrorPopups();
74: }
75: }
76:
77: ?>