Produced by Araxis Merge on 5/29/2018 12:14:36 PM Central Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
# | Location | File | Last Modified |
---|---|---|---|
1 | mobile-kidney-web-2.0.0.zip\mobile-kidney-web\acceptance_test\watir\spec\notifications | Kidney_Tracker_Notification_DCKDA_1159_spec.rb | Wed Apr 4 20:16:46 2018 UTC |
2 | mobile-kidney-web-2.0.0.zip\mobile-kidney-web\acceptance_test\watir\spec\notifications | Kidney_Tracker_Notification_DCKDA_1159_spec.rb | Tue May 29 16:05:39 2018 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 2 | 524 |
Changed | 1 | 2 |
Inserted | 0 | 0 |
Removed | 0 | 0 |
Whitespace | |
---|---|
Character case | Differences in character case are significant |
Line endings | Differences in line endings (CR and LF characters) are ignored |
CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
1 | #!/bin/env ruby | |
2 | # encoding : utf-8 | |
3 | ||
4 | require 'r ubygems' | |
5 | require 'r spec' | |
6 | require 'w atir-webdr iver' | |
7 | ||
8 | require_re lative '.. /rspec_hel per' | |
9 | require_re lative '.. /../lib/pa ges/left_s ide_nav' | |
10 | require_re lative '.. /../lib/pa ges/common _elements' | |
11 | require_re lative '.. /../lib/pa ges/common _tests' | |
12 | require_re lative '.. /../lib/pa ges/error_ validation s' | |
13 | require_re lative '.. /../lib/pa ges/notifi cations' | |
14 | require_re lative '.. /../lib/pa ges/modal_ dialog' | |
15 | require_re lative '.. /../lib/mo dule/Mongo Operations Module' | |
16 | ||
17 | describe ' Story#DCKD A-1159 Kid ney_Tracke r_Notifica tion_DCKDA _1159_spec .rb' , :re gression = > true do | |
18 | include DriverOper ationsModu le | |
19 | include MongoOpera tionsModul e | |
20 | ||
21 | before(: all) do | |
22 | ||
23 | initia lizeConfig urations() | |
24 | remov eCollectio n("notific ations", " notificati onsdb") | |
25 | remov eCollectio n("reminde rs", "remi ndersdb") | |
26 | remov eCollectio n("notific ationPrefe rences", " notificati onsdb") | |
27 | remov eCollectio n("prefere nces", "no tification sdb") | |
28 | ||
29 | @commo nElements = CommonEl ement.new( @driver) | |
30 | @commo nTest = Co mmonTest.n ew(@driver ) | |
31 | @leftn av = LeftS ideNav.new (@driver) | |
32 | @error = Errors. new(@drive r) | |
33 | @tklis tDetail = TrackerLis tDetail.ne w(@driver) | |
34 | @notif ication = Notificati ons.new(@d river) | |
35 | @modal = Modal.n ew(@driver ) | |
36 | ||
37 | @commonTes t.passByLa ndingPageA ndAuthenti cate(" AI ", " AI ", "patien t14, zztes t", "PATID 13") | |
38 | begin | |
39 | Wati r::Wait.un til | |
40 | @com monElement s.angulart itle_eleme nt.visible ? | |
41 | rescue | |
42 | Wati r::Wait::T imeoutErro r | |
43 | unti l | |
44 | @com monElement s.angulart itle_eleme nt.visible ? | |
45 | end | |
46 | end | |
47 | ||
48 | @commo nElements. contentLoa ded_elemen t.when_pre sent(timeo ut=15) | |
49 | @leftn av.leftSid eNav | |
50 | @leftn av.home_el ement.when _visible | |
51 | ||
52 | @leftn av.clickAp pOptionNam e("KidneyT rackers") | |
53 | @commo nElements. secondaryH eader_elem ent.when_v isible(tim eout=10) | |
54 | @commo nElements. contentLoa ded_elemen t.when_pre sent | |
55 | ||
56 | $today Long = get DateNthDay sAgo(0, "% m/%d/%Y") | |
57 | $yeste rdayLong = getDateNt hDaysAgo(1 , "%m/%d/% Y") | |
58 | ||
59 | end | |
60 | ||
61 | after(:a ll) do | |
62 | @drive r.close | |
63 | end | |
64 | ||
65 | subFeatu resParam = [ | |
66 | ||
67 | { :f eatureName => 'Blood Pressure and Pulse Notificati on', :feat ureElement Name => '. blood-pres sure-and-p ulse', :fr equency => "Weekly", :timeStr => ["12:00 PM"], :de livery => ["In-App"] }, | |
68 | { :f eatureName => 'Weigh t Notifica tion', :fe atureEleme ntName => '.weight', :frequenc y => "Mont hly", :tim eStr => [" 08:00 AM"] , :deliver y => ["Ema il"] }, | |
69 | { :f eatureName => 'Gluco se Notific ation', :f eatureElem entName => '.glucose ', :freque ncy => "Da ily", :tim eStr => [" 08:00 AM", "12:00 PM ", "02:00 PM", "06:0 0 PM", "09 :00 PM"], :delivery => ["In-Ap p"] }, | |
70 | { :f eatureName => 'Kidne y Journal Notificati on', :feat ureElement Name => '. kidney-jou rnal', :fr equency => "Weekly", :timeStr => ["02:00 PM"], :de livery => ["Email"] } | |
71 | ||
72 | ] | |
73 | ||
74 | subFeatu resParam.e ach do |fe ature| | |
75 | ||
76 | contex t 'AC#DCKD A-482|TC#D CKDA-528: ' + featu re[:featur eName] + ' - Notific ations fea ture for t he Kidney Trackers' do | |
77 | it ' . Verify t hat the No tification button is present o n the list view and displays t he correct status' d o | |
78 | sl eep 3 | |
79 | @l eftnav.cli ckSubFeatu reName(fea ture[:feat ureElement Name]) | |
80 | @c ommonEleme nts.conten tLoaded_el ement.when _present(t imeout=10) | |
81 | sl eep 1 | |
82 | ex pect(@noti fication.n otificatio nBttn?).to eq(true) | |
83 | ex pect(@noti fication.n otificatio nBttnText) .to eq("No tification (Off)") | |
84 | end | |
85 | ||
86 | it ' . Notifica tion secti on on the Detail vie w has the right labe l, Insturc tional tex t, and Sta tus' do | |
87 | @t klistDetai l.addNewEn try | |
88 | @c ommonEleme nts.conten tLoaded_el ement.when _present(t imeout=10) | |
89 | sl eep 1 | |
90 | ex pect(@noti fication.n otificatio nLabelText ).to eq("N otificatio n:") | |
91 | ex pect(@noti fication.n otificatio nStatusLab el).to eq( "Status:") | |
92 | ex pect(@noti fication.n otificatio nStatus).t o eq("Off" ) | |
93 | ex pectedText = "To edi t the " + feature[:f eatureName ].split(" Notificati on")[0] + " tracker notificati on, select the Notif ication bu tton on th e previous screen." | |
94 | ex pect(@noti fication.i nstruction alText).to eq(expect edText) | |
95 | @c ommonEleme nts.cancel Bttn | |
96 | @c ommonEleme nts.conten tLoaded_el ement.when _present(t imeout=10) | |
97 | end | |
98 | end | |
99 | ||
100 | contex t 'AC#DCKD A-483|TC#D CKDA-528: ' + featu re[:featur eName] + ' - Notific ations But ton from F ilter Scre en' do | |
101 | it ' . Verify t hat screen has the c orrect hea der ' do | |
102 | @n otificatio n.notifica tionBttn_e lement.whe n_present( timeout=10 ) | |
103 | @n otificatio n.notifica tionBttn | |
104 | @c ommonEleme nts.conten tLoaded_el ement.when _present(t imeout=10) | |
105 | ex pectedHead er = featu re[:featur eName] | |
106 | ex pect(@comm onElements .primaryHe ader).to e q(expected Header) | |
107 | end | |
108 | ||
109 | it ' . Verify t hat by def ault, Stat us is set to Off and Start Dat e, Notify Me, and No tification Delivery fields are all disab led,' do | |
110 | ex pect(@noti fication.n otificatio nStatusOnD etail_sele cted?).to eq("Off") | |
111 | ex pect(@noti fication.s tartDateOn Detail_ele ment.attri bute("disa bled")).to eq("true" ) | |
112 | ex pect(@noti fication.n otifyMe_el ement.attr ibute("dis abled")).t o eq("true ") | |
113 | ex pect(@noti fication.n otificatio nTimeWithS tatusOff_e lement.att ribute("ng -disabled" )).to eq(" ngDisabled ") | |
114 | sl eep 1 | |
115 | end | |
116 | ||
117 | it ' . Verify a ll element s labels d isplay cor rectly and required fields are marked as required when statu s is turne d to On' d o | |
118 | @n otificatio n.selectAR adioButton ("On", "no tification Option") | |
119 | ex pect(@noti fication.s tartDateRe quired).to eq("*") | |
120 | ex pect(@noti fication.s tartDateLa bel).to eq ("Start Da te:") | |
121 | ex pect(@noti fication.n otifyMeReq uired).to eq("*") | |
122 | ex pect(@noti fication.n otifyMeLab el).to eq( "Notify Me :") | |
123 | ex pect(@noti fication.n otificatio nDeliveryL abel.inclu de?("*")). to eq(true ) | |
124 | ex pect(@noti fication.n otificatio nDeliveryL abel.inclu de?("Notif ication De livery")). to eq(true ) | |
125 | sl eep 1 | |
126 | end | |
127 | ||
128 | it ' . Verify f ields are required m essages di splay when Save it w ithout pro viding val ues.' do | |
129 | @c ommonEleme nts.saveBt tn | |
130 | @e rror.error Header_ele ment.when_ visible | |
131 | ||
132 | er rMsgArry = [ | |
133 | "Start D ate field is require d.", | |
134 | "A Notif ication De livery met hod is nee ded to sav e this rec ord. Pleas e select a method an d save aga in.", | |
135 | "Notify Me field i s required .", | |
136 | "Notific ation Time field is required." | |
137 | ] | |
138 | ||
139 | er rMsgArry.e ach_with_i ndex do |m sg| | |
140 | expect(@er ror.isThis ErrorDispl ayed(msg)) .to eq(tru e) | |
141 | en d | |
142 | end | |
143 | ||
144 | it ' . Verify t hat Start Date can n ot be in t he past.' do | |
145 | @n otificatio n.startDat eOnDetail= $yesterda yLong | |
146 | @c ommonEleme nts.saveBt tn_element .hover | |
147 | @c ommonEleme nts.saveBt tn | |
148 | @e rror.error Header_ele ment.when_ visible(ti meout=10) | |
149 | er rMsg = "St art Date m ust be bet ween " + $ todayLong + " and 12 /31/2099." | |
150 | ex pect(@erro r.isThisEr rorDisplay ed(errMsg) ).to eq(tr ue) | |
151 | end | |
152 | ||
153 | it ' . Verify t hat Notify Me set to Select as default a nd has Dai ly, Weekly , Monthly values' do | |
154 | ex pect(@noti fication.n otifyMe_op tions).to eq(["Selec t", "Daily ", "Weekly ", "Monthl y"]) | |
155 | ex pect(@noti fication.n otifyMe).t o eq("Sele ct") | |
156 | end | |
157 | ||
158 | it ' . Verify t hat when s elect Noti fy Me to D aily, Week ly or Mont hly, Notif ication Ti me field b ecomes req uired' do | |
159 | ||
160 | no tifyMeArry = [ | |
161 | {:metho d => "Week ly", :err Msg => "No tification Time fiel d is requi red."} , | |
162 | {:metho d => "Mont hly", :err Msg => "No tification Time fiel d is requi red."} , | |
163 | {:metho d => "Dail y", :err Msg => "No tification Time numb er 1 field is requir ed."} | |
164 | ] | |
165 | ||
166 | no tifyMeArry .each do | value| | |
167 | ||
168 | @notificat ion.notify Me= value[ :method] | |
169 | sleep 0.5 | |
170 | expect(@no tification .notificat ionTimeLab el.include ?("* ")).t o eq(true) | |
171 | expect(@no tification .notificat ionTimeLab el.include ?("Notific ation Time :")).to eq (true) | |
172 | @commonEle ments.save Bttn | |
173 | @error.err orHeader_e lement.whe n_visible | |
174 | expect(@er ror.isThis ErrorDispl ayed(value [:errMsg]) ).to eq(tr ue) | |
175 | en d | |
176 | end | |
177 | ||
178 | it ' . Verify t hat when s elect Dail y, Add Tim e button i s visible and can ad d up to fi ve time en tries. Eac h time ent ry has a d elete butt on. Click the delete button re move the c orrespondi ng time en try' do | |
179 | ex pect(@noti fication.a ddTimeBttn ?).to eq(t rue) | |
180 | fo r i in 1.. 4 | |
181 | @notificat ion.addTim eBttn | |
182 | sleep 0.5 | |
183 | expect(@no tification .verifyThe NewTimeEnt ryAppears( i)).to eq( true) | |
184 | en d | |
185 | ex pect(@noti fication.a ddTimeBttn ?).to eq(f alse) | |
186 | ||
187 | fo r i in 4.. 1 | |
188 | @notificat ion.clickD eleteTimeB utton(i) | |
189 | sleep 0.5 | |
190 | expect(@no tification .verifyThe NewTimeEnt ryAppears( i)).to eq( false) | |
191 | expect(@no tification .addTimeBt tn?).to eq (true) | |
192 | en d | |
193 | end | |
194 | ||
195 | it ' . Verify t hat Notifi cation Del ivery has two checkb oxes and n one was pr e-checked as default ' do | |
196 | ex pect(@noti fication.n otificatio nDeliveryC BX_checked ?).to eq(f alse) | |
197 | end | |
198 | ||
199 | it ' . Verify t hat email address di splays whe n email is available and it di splays an instructio nal text' do | |
200 | ex pect(@noti fication.d isplayedEm ail).to eq ("test@tes t.com") | |
201 | ex pect(@noti fication.i nstruTextO nDetail).t o eq("You may update your Pref erred Emai l address in the Not ification feature by selecting the notif ication se ttings ico n") | |
202 | end | |
203 | end | |
204 | ||
205 | contex t 'AC#DCKD A-486|TC#D CKDA-528: ' + featu re[:featur eName] + ' - Previou s Button N avigation for Kidney Tracker N otificatio n' do | |
206 | it ' . Verify t hat < is s hown on th e detil sc reen and h as the cor rect alt t ext. Click ing it ret urns the u ser to the list view ' do | |
207 | ||
208 | ex pect(@comm onElements .returnToP revScreen? ).to eq(tr ue) | |
209 | ex pect(@comm onElements .returnToP revScreen_ element.at tribute('t itle')).to eq("Retur n to Previ ous Screen ") | |
210 | ||
211 | @c ommonEleme nts.return ToPrevScre en | |
212 | @m odal.modal Title_elem ent.when_v isible | |
213 | @m odal.yes | |
214 | @c ommonEleme nts.conten tLoaded_el ement.when _present(t imeout=15) | |
215 | ex pect(@comm onElements .primaryHe ader).to e q(feature[ :featureNa me].split( " Notifica tion")[0]) | |
216 | sl eep 1 | |
217 | end | |
218 | end | |
219 | ||
220 | contex t 'AC#DCKD A-483|TC#D CKDA-528: ' + featu re[:featur eName] + ' - Happy P ath. Creat e a notifi cation' do | |
221 | it ' . Fill out all requi red fields to create a notific ation' do | |
222 | @n otificatio n.notifica tionBttn | |
223 | @c ommonEleme nts.conten tLoaded_el ement.when _present(t imeout=15) | |
224 | ||
225 | de liveryMeth od = featu re[:delive ry][0] | |
226 | @n otificatio n.addANoti fication($ todayLong, feature[: frequency] , feature[ :timeStr], deliveryM ethod) | |
227 | @c ommonEleme nts.conten tLoaded_el ement.when _present(t imeout=15) | |
228 | ex pect(@noti fication.n otificatio nBttnText) .to eq("No tification (On)") | |
229 | end | |
230 | ||
231 | it ' . Verify f rom Mongo DB the spe cific noti fication i s generate d accordin gly' do | |
232 | fi nalName = feature[:f eatureName ].split(" Notificati on")[0] | |
233 | ||
234 | va lidateStr = [ | |
235 | ||
236 | {:column Name => "s ource", :e xpectValue => "Mobil eKidney - Kidney Tra ckers - " + finalNam e}, | |
237 | {:column Name => "f requency", :expectVa lue => fea ture[:freq uency]}, | |
238 | {:column Name => "e ventDate", :expectVa lue => $to dayLong}, | |
239 | {:column Name => "n otificatio nTypes", : expectValu e => featu re[:delive ry]}, | |
240 | {:column Name => "t imes", :ex pectValue => feature [:timeStr] }, | |
241 | ] | |
242 | ||
243 | va lidateStr. each do |v alidationI tem| | |
244 | ||
245 | if validat ionItem[:c olumnName] == "event Date" | |
246 | tempValu e = retrie veThisFiel dInDocumen t("reminde rs", "remi ndersdb", "EDIPI", " PATID13", validation Item[:colu mnName]) | |
247 | mongoVal ue = tempV alue.strft ime("%m/%d /%Y") | |
248 | else | |
249 | mongoVal ue = retri eveThisFie ldInDocume nt("remind ers", "rem indersdb", "EDIPI", "PATID13", validatio nItem[:col umnName]) | |
250 | end | |
251 | puts "mong oValue=" + mongoValu e.to_s | |
252 | puts "vali dationItem [:expectVa lue]:" + v alidationI tem[:expec tValue].to _s | |
253 | expect(mon goValue).t o eq(valid ationItem[ :expectVal ue]) | |
254 | en d | |
255 | ||
256 | re moveCollec tion("remi nders", "r emindersdb ") | |
257 | end | |
258 | ||
259 | end | |
260 | ||
261 | end | |
262 | ||
263 | end |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.