1: <?php
2: namespace Azalea\Selenium\EHR\UI\Patients;
3:
4: 5: 6:
7:
8: class PatientComments extends PatientSection
9: {
10:
11: protected static $hash = "/patients/p/{pat_id}/comments";
12:
13: protected static $selectorSection = "#pat_dash_comments_section";
14:
15: 16: 17: 18: 19:
20: protected static $COMMENT_BUTTON_NEW = ".new_comment";
21: protected static $COMMENT_BUTTON_SUBMIT = "#btn_patient_comment_submit";
22: protected static $COMMENT_BUTTON_CANCEL = "#btn_patient_comment_cancel";
23: protected static $COMMENT_FIELD = "#note_field";
24: protected static $COMMENT_POPUP = ".new_popup";
25: protected static $POPUP_CONTENT_FIELD = "#ppr_note";
26: protected static $POPUP_BUTTON_SUBMIT = "#ppr_submit";
27: protected static $POPUP_BUTTON_CANCEL = "#ppr_cancel";
28: protected static $POPUP_SELECT_GROUPS = "#ppr_grp_id";
29: protected static $POPUP_SELECT_AREAS = "#ppr_apa_id";
30:
31: 32: 33: 34: 35:
36: public function clickCommentButtonNew()
37: {
38: $this->clickAndWait($this->byCss(self::$COMMENT_BUTTON_NEW), 1);
39: }
40:
41: public function clickCommentButtonSubmit()
42: {
43: $this->hasCommentButtonSubmit();
44: $this->clickAndWait($this->byCss(self::$COMMENT_BUTTON_SUBMIT), 1);
45: }
46:
47: public function clickCommentButtonCancel()
48: {
49: $this->hasCommentButtonCancel();
50: $this->clickAndWait($this->byCss(self::$COMMENT_BUTTON_CANCEL), 1);
51: }
52:
53:
54: public function hasCommentField()
55: {
56: $this->displayed($this->byCss(self::$COMMENT_FIELD));
57: }
58:
59: public function commentFieldSetText($text)
60: {
61: $this->byCss(self::$COMMENT_FIELD)->value($text);
62: }
63:
64: public function hasCommentButtonSubmit()
65: {
66: $this->displayed($this->byCss(self::$COMMENT_BUTTON_SUBMIT));
67: }
68:
69: public function hasCommentButtonCancel()
70: {
71: $this->displayed($this->byCss(self::$COMMENT_BUTTON_CANCEL));
72: }
73:
74: public function getComment($index=0)
75: {
76:
77:
78: return $this->byCss('#patient_comments tr[data-grid-row="'.$index.'"] > td > div')->text();
79: }
80:
81: 82: 83: 84: 85:
86: public function clickPopupButtonNew()
87: {
88: $this->clickAndWait($this->byCss(self::$COMMENT_POPUP), 1);
89: }
90:
91: public function clickPopupButtonSubmit()
92: {
93: $this->hasPopupButtonSubmit();
94: $this->clickAndWait($this->byCss(self::$POPUP_BUTTON_SUBMIT), 1);
95: }
96:
97: public function clickPopupButtonCancel()
98: {
99: $this->hasPopupButtonCancel();
100: $this->clickAndWait($this->byCss(self::$POPUP_BUTTON_CANCEL), 1);
101: }
102:
103: public function hasPopupButtonSubmit()
104: {
105: $this->displayed($this->byCss(self::$POPUP_BUTTON_SUBMIT));
106: }
107:
108: public function hasPopupButtonCancel()
109: {
110: $this->displayed($this->byCss(self::$POPUP_BUTTON_CANCEL));
111: }
112:
113: public function hasPopupContentField()
114: {
115: $this->displayed($this->byCss(self::$POPUP_CONTENT_FIELD));
116: }
117:
118: public function popupContentFieldSetText($text)
119: {
120: $this->byCss(self::$POPUP_CONTENT_FIELD)->value($text);
121: }
122:
123: public function verify($args = array())
124: {
125: if (parent::verify($args)) {
126: $this->byCss($this->getSelectorSection());
127: return true;
128: }
129: return false;
130: }
131: }