Produced by Araxis Merge on 5/29/2018 12:14:33 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\kidney-tracker | Kidney_Journal_Add_Edit_Delete_DCKDA_500_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\kidney-tracker | Kidney_Journal_Add_Edit_Delete_DCKDA_500_spec.rb | Tue May 29 15:46:32 2018 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 2 | 672 |
Changed | 1 | 4 |
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/modal_ dialog' | |
13 | require_re lative '.. /../lib/pa ges/filter s' | |
14 | require_re lative '.. /../lib/pa ges/error_ validation s' | |
15 | require_re lative '.. /../lib/pa ges/tracke rs_list_an d_detail' | |
16 | require_re lative '.. /../lib/mo dule/FHIRO perationsM odule' | |
17 | ||
18 | describe ' Story#DCKD A-500 Kidn ey_Journal _Add_Edit_ Delete_DCK DA_500_spe c.rb', :re gression = > true do | |
19 | include DriverOper ationsModu le | |
20 | include FHIROperat ionsModule | |
21 | ||
22 | before(: all) do | |
23 | $patie ntId = "PA TID13" | |
24 | $first Name = "zz test" | |
25 | $lastN ame = "pat ient14" | |
26 | $userName = " AI " | |
27 | $password = " AI " | |
28 | ||
29 | initia lizeConfig urations() | |
30 | remove KidneyJour nalEntries ($patientI d, $firstN ame, $last Name) | |
31 | ||
32 | @commo nElements = CommonEl ement.new( @driver) | |
33 | @commo nTest = Co mmonTest.n ew(@driver ) | |
34 | @leftn av = LeftS ideNav.new (@driver) | |
35 | @modal = Modal.n ew(@driver ) | |
36 | @filte r = Filter s.new(@dri ver) | |
37 | @error = Errors. new(@drive r) | |
38 | @tklis tDetail = TrackerLis tDetail.ne w(@driver) | |
39 | ||
40 | @commo nTest.pass ByLandingP ageAndAuth enticate($ userName, $password, "#{$lastN ame}, #{$f irstName}" , $patient Id) | |
41 | ||
42 | begin | |
43 | Wati r::Wait.un til | |
44 | @com monElement s.angulart itle_eleme nt.visible ? | |
45 | rescue | |
46 | Wati r::Wait::T imeoutErro r | |
47 | unti l | |
48 | @com monElement s.angulart itle_eleme nt.visible ? | |
49 | end | |
50 | end | |
51 | ||
52 | @commo nTest.wait ForContent LoadedSumm aryPage | |
53 | @leftn av.leftSid eNav | |
54 | ||
55 | @leftn av.home_el ement.when _visible | |
56 | ||
57 | ||
58 | @commo nTest.navi gateToAsub Feature("K idneyTrack ers", ".ki dney-journ al") | |
59 | @commo nElements. contentLoa ded_elemen t.when_pre sent | |
60 | ||
61 | $today Long = get DateNthDay sAgo(0, "% m/%d/%Y") | |
62 | $yeste rdayShort = getDateN thDaysAgo( 1, "%m/%d/ %y") | |
63 | $yeste rdayLong = getDateNt hDaysAgo(1 , "%m/%d/% Y") | |
64 | $tomor row = getD ateNthDays FromNow(1, "%m/%d/%Y ") | |
65 | $sixYe arsAgo = g etDateNthY earsAgo(6, "%m/%d/%Y ") | |
66 | $sixYe ars1dayAgo = getDate NthDaysAgo (2193, "%m /%d/%Y") | |
67 | $oneYe arAgo = ge tDateNthYe arsAgo(1, "%m/%d/%Y" ) | |
68 | ||
69 | $twoMo nthsAgo = getDateNth MonthsAgo( 2, "%m/%d/ %Y") | |
70 | $oneMo nthAgo = g etDateNthM onthsAgo(1 , "%m/%d/% Y") | |
71 | $tenDa ysAgo = ge tDateNthDa ysAgo(10, "%m/%d/%Y" ) | |
72 | ||
73 | end | |
74 | ||
75 | after(:a ll) do | |
76 | @drive r.close | |
77 | end | |
78 | ||
79 | context 'AC#DCKDA- 614|TC#DCK DA-1184: Add New En try for Ki dney Journ al' do | |
80 | it '. Verify the Add (+) b utton is a vailable' do | |
81 | expe ct(@tklist Detail.add NewEntry?) .to eq(tru e) | |
82 | end | |
83 | ||
84 | it '. Verify the detail sc reen heade r displays correctly ' do | |
85 | @tkl istDetail. addNewEntr y | |
86 | @com monElement s.primaryH eader_elem ent.when_v isible(tim eout=10) | |
87 | expe ct(@common Elements.p rimaryHead er).to eq( "Add Kidne y Journal Entry") | |
88 | end | |
89 | ||
90 | it '. Verify the instructi onal text displays c orrectly.' do | |
91 | @tkl istDetail. instrTextS ec1_elemen t.when_vis ible(timeo ut=10) | |
92 | expe ct(@tklist Detail.ins trTextSec1 ).to eq("J ournal Ent ries allow you to tr ack and sh are things with your VA care t eam so you can:") | |
93 | expe ct(@tklist Detail.ret rieveInstr uTextSec2B ullPoints( 1)).to eq( "Help your care team focus on what's imp ortant to you") | |
94 | expe ct(@tklist Detail.ret rieveInstr uTextSec2B ullPoints( 2)).to eq( "Make sure you don't forget ab out someth ing you wa nt to know ") | |
95 | expe ct(@tklist Detail.ret rieveInstr uTextSec2B ullPoints( 3)).to eq( "Get answe rs to all your quest ions") | |
96 | end | |
97 | ||
98 | it '. Verify tha t required field ind icator is present an d all fiel ds are pre sent with the correc t labels' do | |
99 | expe ct(@common Elements.r equiredFie ldLabel).t o eq("* re quired fie ld") | |
100 | expe ct(@tklist Detail.dat eLabel).to eq("* Dat e:") | |
101 | expe ct(@tklist Detail.tim eLabel).to eq("* Tim e:") | |
102 | expe ct(@tklist Detail.req uiredMarkF orTitle + " " + @tkl istDetail. titleLabel ).to eq("* Title:") | |
103 | expe ct(@tklist Detail.mar kFollowUpL abel).to e q("Mark fo r Follow-U p") | |
104 | expe ct(@tklist Detail.not eLabel).to eq("Note: ") | |
105 | ||
106 | end | |
107 | ||
108 | it '. Verify tha t the MM/D D/YYYY dis plays as t he format guidance a t Date fie ld; HH:MM AM/PM disp lays as th e format g uidance at Time fiel d' do | |
109 | expe ct(@tklist Detail.dat eOnDetail_ element.at tribute('p laceholder ')).to eq( "MM/DD/YYY Y") | |
110 | expe ct(@tklist Detail.tim eOnDetail_ element.at tribute('p laceholder ')).to eq( "HH:MM AM/ PM") | |
111 | end | |
112 | ||
113 | it '. Verify tha t Date is required a nd can not be future date; Tim e is requi red.' do | |
114 | @tkl istDetail. dateOnDeta il= "" | |
115 | slee p 0.5 | |
116 | @tkl istDetail. timeOnDeta il= "" | |
117 | slee p 0.5 | |
118 | ||
119 | @tkl istDetail. timeOnDeta il_element .send_keys (:tab) | |
120 | @com monElement s.scrollDo wn(@driver ) | |
121 | ||
122 | @tkl istDetail. saveBttn_e lement.foc us | |
123 | @tkl istDetail. saveBttn | |
124 | ||
125 | @err or.errorHe ader_eleme nt.when_vi sible | |
126 | expe ct(@error. isThisErro rDisplayed ("Date fie ld is requ ired.")).t o eq(true) | |
127 | expe ct(@error. isThisErro rDisplayed ("Time fie ld is requ ired.")).t o eq(true) | |
128 | ||
129 | @tkl istDetail. dateOnDeta il= $tomor row | |
130 | slee p 0.5 | |
131 | @tkl istDetail. saveBttn | |
132 | errM sg = "Dat e must be between " + $sixYear sAgo + " a nd " + $to dayLong + "." | |
133 | #put s "errMsg= " + errMsg | |
134 | expe ct(@error. isThisErro rDisplayed (errMsg)). to eq(true ) | |
135 | end | |
136 | ||
137 | it '. Verify tha t the Titl e field on ly allows maximum 25 character s ' do | |
138 | expe ct(@tklist Detail.tex tareaMaxLe ngthTest(2 5, false, "input","T itle")).to eq(1) | |
139 | end | |
140 | ||
141 | it '. Verify the Mark for Follow-Up check box has the ri ght lable and is unc hecked by default' d o | |
142 | expe ct(@tklist Detail.fol lowUp_chec ked?).to e q(false) | |
143 | expe ct(@tklist Detail.mar kFollowUpL abel).to e q("Mark fo r Follow-U p") | |
144 | end | |
145 | ||
146 | it '. Verify the Note fiel d has a ch aracter co unter and it allows max 250 ch aracters' do | |
147 | expe ct(@tklist Detail.cha racterCoun ter?).to e q(true) | |
148 | expe ct(@tklist Detail.tex tareaMaxLe ngthTest(2 50, true, "textarea" , "Note")) .to eq(1) | |
149 | @tkl istDetail. cancelBttn | |
150 | @tkl istDetail. addNewEntr y_element. when_visib le(timeout =10) | |
151 | end | |
152 | ||
153 | it '. Happy path , to add t hree entri es. Verify the value s are save d and they display c orrectly i n the Tabl e View' do | |
154 | jour nalMetaDat a = [ | |
155 | { :dateStr => $twoMo nthsAgo, : timeStr => "12:00 PM ", :titleS tr => 'Die t plan fol low up - 2 ', :checkF lwUpFlag = > false, : note => "" }, | |
156 | { :dateStr => $oneMo nthAgo, :t imeStr => "08:00 PM" , :titleSt r => 'Diet plan foll ow up - 1' , :checkFl wUpFlag => true, :no te => "" } , | |
157 | { :dateStr => $tenDa ysAgo, :ti meStr => " 12:59 PM", :titleStr => 'Start a diet pl an', :chec kFlwUpFlag => true, :note => " I hope thi s goes smo othly. I w ill follow up every 5 days." } | |
158 | ] | |
159 | ||
160 | jour nalMetaDat a.each_wit h_index do |record, index| | |
161 | pu ts record[ :dateStr], record[:t imeStr], r ecord[:tit leStr], re cord[:chec kFlwUpFlag ], record[ :note] | |
162 | @t klistDetai l.addAJour nalEntry(r ecord[:dat eStr], rec ord[:timeS tr], recor d[:titleSt r], record [:checkFlw UpFlag], r ecord[:not e]) | |
163 | sl eep 2 | |
164 | @t klistDetai l.summaryT able_eleme nt.when_vi sible(time out=15) | |
165 | va lueStr = r ecord[:tit leStr] + ' , ' + reco rd[:dateSt r] + ' ' + record[:t imeStr] | |
166 | ||
167 | pu ts valueSt r | |
168 | ||
169 | if record[:n ote] != "" | |
170 | hasIcon = true | |
171 | el se | |
172 | hasIcon = false | |
173 | en d | |
174 | ||
175 | ex pect(@tkli stDetail.v erifyValue sDisplayRi ghtInTable View(1, 3, valueStr, hasIcon)) .to eq(tru e) | |
176 | end | |
177 | end | |
178 | end | |
179 | ||
180 | context 'AC#DCKDA- 615|TC#DCK DA-1184: Edit an En try for Ki dney Journ al Tracker ' do | |
181 | it '. Verify tha t All data elements available in Add Ent ry mode ar e visible. ' do | |
182 | ||
183 | sleep 20 | |
184 | ||
185 | @tkl istDetail. clickAnEnt ryToEditOr Delete(1) | |
186 | @com monTest.wa itForConte ntLoaded | |
187 | expe ct(@common Elements.p rimaryHead er).to eq( "Edit Kidn ey Journal Entry") | |
188 | expe ct(@tklist Detail.dat eLabel).to eq("* Dat e:") | |
189 | expe ct(@tklist Detail.tim eLabel).to eq("* Tim e:") | |
190 | expe ct(@tklist Detail.req uiredMarkF orTitle + " " + @tkl istDetail. titleLabel ).to eq("* Title:") | |
191 | expe ct(@tklist Detail.mar kFollowUpL abel).to e q("Mark fo r Follow-U p") | |
192 | expe ct(@tklist Detail.not eLabel).to eq("Note: ") | |
193 | end | |
194 | ||
195 | it '. Verify tha t all valu es previou sly saved are visibl e.' do | |
196 | ||
197 | expe ct(@tklist Detail.dat eOnDetail) .to eq($te nDaysAgo) | |
198 | expe ct(@tklist Detail.tim eOnDetail) .to eq("12 :59 PM") | |
199 | expe ct(@tklist Detail.tit leEditBox) .to eq("St art a diet plan") | |
200 | expe ct(@tklist Detail.fol lowUp_chec ked?).to e q(true) | |
201 | expe ct(@tklist Detail.not e).to eq(" I hope thi s goes smo othly. I w ill follow up every 5 days.") | |
202 | end | |
203 | ||
204 | it '. Modify a v alue and s ave. Verif y the upda ted value displays i n the tabl e view' do | |
205 | @tkl istDetail. timeOnDeta il= "12:00 AM" | |
206 | @com monElement s.scrollDo wn(@driver ) | |
207 | @tkl istDetail. saveBttn | |
208 | slee p 2 | |
209 | @tkl istDetail. summaryTab le_element .when_visi ble(timeou t=15) | |
210 | expe ct(@tklist Detail.ver ifyValuesD isplayRigh tInTableVi ew(1, 3, " Start a di et plan, # {$tenDaysA go} 12:00 AM", true) ).to eq(tr ue) | |
211 | end | |
212 | ||
213 | it '. Verify tha t the Last Updated t ext displa ys the cor rect date/ time the r ecord was previously edited' d o | |
214 | @tkl istDetail. clickAnEnt ryToEditOr Delete(1) | |
215 | @com monTest.wa itForConte ntLoaded | |
216 | dbDa teTime = g etLastUpda tedDateOfK idneyJourn alByTitle( "Start a d iet plan", $patientI d, $firstN ame, $last Name) | |
217 | puts "dbDateTi me=" + dbD ateTime | |
218 | ||
219 | expe ctedText = "Last Upd ated: " + dbDateTime .to_s | |
220 | expe ct(@tklist Detail.las tUpdatedTe xt_element .text.stri p).to eq(e xpectedTex t) | |
221 | @tkl istDetail. cancelBttn | |
222 | @tkl istDetail. addNewEntr y_element. when_visib le(timeout =10) | |
223 | end | |
224 | end | |
225 | ||
226 | context 'AC#DCKDA- 616|TC#DCK DA-1184: Cancel and Delete fo r Kidney J ournal' do | |
227 | it '. Verify tha t When a u ser select s Cancel, no updates are made to the rec ord.' do | |
228 | @tkl istDetail. clickAnEnt ryToEditOr Delete(1) | |
229 | @com monElement s.scrollDo wn(@driver ) | |
230 | @tkl istDetail. cancelBttn | |
231 | @tkl istDetail. summaryTab le_element .when_visi ble(timeou t=15) | |
232 | ||
233 | expe ct(@tklist Detail.ver ifyValuesD isplayRigh tInTableVi ew(1, 3, " Start a di et plan, # {$tenDaysA go} 12:00 AM", true) ).to eq(tr ue) | |
234 | end | |
235 | ||
236 | it '. Verify tha t When a u ser select s Delete, the system prompts t he user to confirm t he Delete by display ing a moda l:' do | |
237 | @tkl istDetail. clickAnEnt ryToEditOr Delete(1) | |
238 | @com monElement s.scrollDo wn(@driver ) | |
239 | @tkl istDetail. deleteBttn | |
240 | @mod al.modalTi tle_elemen t.when_vis ible | |
241 | expe ct(@modal. modalTitle ).to eq("C onfirmatio n") | |
242 | expe ct(@modal. section1). to eq("Are you sure you want t o remove t his entry? Select YE S to remov e the entr y or NO to return to the entry screen.") | |
243 | @mod al.ok2 | |
244 | @mod al.modalTi tle_elemen t.when_not _visible | |
245 | expe ct(@common Elements.p rimaryHead er).to eq( "Edit Kidn ey Journal Entry") | |
246 | ||
247 | begi n | |
248 | Wa tir::Wait. until | |
249 | @t klistDetai l.busySpin ner_elemen t.when_not _visible | |
250 | resc ue | |
251 | Wa tir::Wait: :TimeoutEr ror | |
252 | un til | |
253 | @t klistDetai l.busySpin ner_elemen t.when_not _visible | |
254 | en d | |
255 | end | |
256 | ||
257 | slee p 1 | |
258 | ||
259 | @tkl istDetail. deleteBttn | |
260 | @mod al.modalTi tle_elemen t.when_vis ible | |
261 | @mod al.yes | |
262 | valu eStr = "10 /01/2016 1 2:59 PM" | |
263 | expe ct(@tklist Detail.sea rchThisVal ueInAllRow s(2, value Str)).to e q(false) | |
264 | end | |
265 | end | |
266 | ||
267 | context 'AC#DCKDA- 617|TC#DCK DA-1184: N avigation' do | |
268 | it '. Verify tha t < is sho wn on the list scree n when on a phone vi ew and has the corre ct alt tex t. Clickin g it retur ns the use r to the l ist view' do | |
269 | begi n | |
270 | Wa tir::Wait. until | |
271 | @t klistDetai l.busySpin ner_elemen t.when_not _visible | |
272 | resc ue | |
273 | Wa tir::Wait: :TimeoutEr ror | |
274 | un til | |
275 | @t klistDetai l.busySpin ner_elemen t.when_not _visible | |
276 | en d | |
277 | end | |
278 | ||
279 | @tkl istDetail. addNewEntr y_element. when_visib le | |
280 | @tkl istDetail. addNewEntr y | |
281 | @com monTest.wa itForConte ntLoaded | |
282 | ||
283 | resi zeWindowTo (320, 480) | |
284 | expe ct(@common Elements.r eturnToPre vScreen?). to eq(true ) | |
285 | expe ct(@common Elements.r eturnToPre vScreen_el ement.attr ibute('tit le')).to e q("Return to Previou s Screen") | |
286 | ||
287 | @com monElement s.returnTo PrevScreen | |
288 | @com monElement s.primaryH eader_elem ent.when_v isible(tim eout=10) | |
289 | expe ct(@common Elements.p rimaryHead er).to eq( "Kidney Jo urnal") | |
290 | ||
291 | end | |
292 | ||
293 | it '. Verify use r is promp t with a m odal when clicking < with unsa ved data' do | |
294 | @tkl istDetail. startDate_ element.se nd_keys(:t ab) | |
295 | @tkl istDetail. startDate | |
296 | @tkl istDetail. clickAnEnt ryToEditOr Delete(1) | |
297 | @tkl istDetail. timeOnDeta il = "11:0 0 AM" | |
298 | @com monElement s.returnTo PrevScreen | |
299 | @mod al.modalTi tle_elemen t.when_vis ible | |
300 | expe ct(@modal. modalTitle ).to eq("C onfirmatio n") | |
301 | expe ct(@modal. section1). to eq("You have not saved your changes. If you wis h to conti nue withou t saving s elect CONT INUE, othe rwise sele ct RETURN to return to the ent ry screen. ") | |
302 | ||
303 | @mod al.ok2 | |
304 | @mod al.modalTi tle_elemen t.when_not _visible | |
305 | expe ct(@common Elements.p rimaryHead er).to eq( "Edit Kidn ey Journal Entry") | |
306 | ||
307 | @tkl istDetail. timeOnDeta il= "11:00 AM" | |
308 | @com monElement s.returnTo PrevScreen | |
309 | @mod al.modalTi tle_elemen t.when_vis ible | |
310 | ||
311 | @mod al.yes | |
312 | @mod al.modalTi tle_elemen t.when_not _visible | |
313 | expe ct(@common Elements.p rimaryHead er).to eq( "Kidney Jo urnal") | |
314 | ||
315 | end | |
316 | ||
317 | it '. Verify tha t when nav igate away from a sc reen with unsaved da ta, the sa me modal p ops up' do | |
318 | @tkl istDetail. startDate_ element.se nd_keys(:t ab) | |
319 | @tkl istDetail. startDate | |
320 | Wati r::Wait.un til {@tkli stDetail.t ext.includ e? "Title" } | |
321 | ||
322 | @tkl istDetail. clickAnEnt ryToEditOr Delete(1) | |
323 | @tkl istDetail. timeOnDeta il= "11:00 AM" | |
324 | ||
325 | @lef tnav.leftS ideNav | |
326 | @lef tnav.home_ element.wh en_visible | |
327 | @lef tnav.learn More | |
328 | @mod al.modalTi tle_elemen t.when_vis ible | |
329 | expe ct(@modal. modalTitle ).to eq("C onfirmatio n") | |
330 | expe ct(@modal. section1). to eq("You have not saved your changes. If you wis h to conti nue withou t saving s elect CONT INUE, othe rwise sele ct RETURN to return to the ent ry screen. ") | |
331 | ||
332 | @mod al.yes | |
333 | ||
334 | resi zeWindowTo Default() | |
335 | ||
336 | end | |
337 | end | |
338 | end |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.