Produced by Araxis Merge on 12/7/2018 11:36:06 AM Central Standard 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 | C:\SCRUB\MHED\MHED\VAR 4.10.0\var-web-release-4.10@e10f18de1ef\veteran-appointment-requests\test\watir-ruby\spec\appointments | add_new_appointment_spec.rb | Mon Oct 22 23:25:20 2018 UTC |
| 2 | C:\MHED-scrubbed\MHED\MHED\VAR 4.10.0\var-web-release-4.10@e10f18de1ef\veteran-appointment-requests\test\watir-ruby\spec\appointments | add_new_appointment_spec.rb | Fri Dec 7 13:25:46 2018 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 4 | 1010 |
| Changed | 3 | 6 |
| 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 | require 'r ubygems' | |
| 4 | require 'r spec' | |
| 5 | require 'w atir-webdr iver' | |
| 6 | require 'p age-object ' | |
| 7 | require 'o ci8' | |
| 8 | ||
| 9 | require_re lative '.. /../module /DriverUti lity' | |
| 10 | require_re lative '.. /rspec_hel per' | |
| 11 | require_re lative '.. /../pages/ landing' | |
| 12 | require_re lative '.. /../pages/ login' | |
| 13 | require_re lative '.. /../pages/ eula' | |
| 14 | require_re lative '.. /../common /common' | |
| 15 | require_re lative '.. /../common /cancel_ap pointment' | |
| 16 | require_re lative '.. /../pages/ landing_ap pointments ' | |
| 17 | require_re lative '.. /../pages/ appointmen ts/new_app ointment_r equest' | |
| 18 | require_re lative '.. /../pages/ appointmen ts/booked_ appointmen t_detail' | |
| 19 | require_re lative '.. /../helper /modal' | |
| 20 | require_re lative '.. /../module /database/ OracleUtil ity' | |
| 21 | require_re lative '.. /../module /DateUtili ty' | |
| 22 | require_re lative '.. /../helper /error_val idation' | |
| 23 | require_re lative '.. /../module /database/ MongoUtili ty' | |
| 24 | require_re lative '.. /../pages/ feedback' | |
| 25 | require_re lative '.. /../pages/ landing_no tification s' | |
| 26 | ||
| 27 | ||
| 28 | describe ' [Story# VA R-1928: Ne w Appointm ent - Ente r Details] | |
| 29 | [Story# VA R-1921: Ne w Appointm ent/Reques t - Appoin tment vs R equest Rou ting Quest ion Update s] | |
| 30 | [Story# VA R-2652: Ne w Appointm ent – Appo intment De tail Updat es - Dynam ic Clinic list] | |
| 31 | [Story# VA R-2770: Ne w Appointm ent - Pref erred Date Display]' do | |
| 32 | ||
| 33 | include DriverUtil ity | |
| 34 | include OracleUtil ity | |
| 35 | include DateUtilit y | |
| 36 | include MongoUtili ty | |
| 37 | ||
| 38 | ||
| 39 | before(: all) do | |
| 40 | initia lizeConfig urations(V AR_BASE_UR L) | |
| 41 | @landi ng_appoint ments = La ndingAppoi ntments.ne w(@driver) | |
| 42 | @login = Login.n ew(@driver ) | |
| 43 | @eula = Eula.new (@driver) | |
| 44 | @commo n = Common .new(@driv er) | |
| 45 | @modal = Modal.n ew(@driver ) | |
| 46 | @new_a ppointment = NewAppo intmentReq uest.new(@ driver) | |
| 47 | @detai l = Booked Appointmen tDetail.ne w(@driver) | |
| 48 | @error = Error_V alidation. new(@drive r) | |
| 49 | @feedb ack = Feed back.new(@ driver) | |
| 50 | @landi ng_notific ations = L andingNoti fications. new(@drive r) | |
| 51 | TITLE = "Appoint ments/Requ ests" | |
| 52 | @tomor row = getD ateNthDays FromNow(1, "%m/%d/%Y ") | |
| 53 | @seven DaysFromNo w = getDat eNthDaysFr omNow(7, " %m/%d/%Y") | |
| 54 | @ninty DaysLater = getDateN thDaysFrom Now(90, "% m/%d/%Y") | |
| 55 | @@pati entID ="11 13138327" | |
| 56 | #cance l appointm ent | |
| 57 | @cancel_ap pointment = CancelAp pointment. new("CLINI C_BASED_BO STON", "52 3","#{ pw_reda c t e d ['userid'] }") | |
| 58 | @cance l_appointm ent.update _appointme nt_obj("ap pointmentT ime", "#{@ sevenDaysF romNow} 10 :00:00") | |
| 59 | @cance l_appointm ent.cancel _appointme nt() | |
| 60 | #mongo | |
| 61 | @db = connectToM ongoDB("va r-utility" ) | |
| 62 | restor eCollectio n("siteSup portingVAR ", "var-ut ility", "s ites-suppo rting-var- exported2. json", @db ) | |
| 63 | restor eCollectio n("clinica l-services ", "var-ut ility", "c linical_se rvices_def ault.json" , @db) | |
| 64 | restor eCollectio n("directB ookingElig ibilityCri teria", "v ar-utility ", "direct Scheduling Enabled.js on", @db) | |
| 65 | restor eCollectio n("request Eligibilit yCriteria" , "var-uti lity", "re questEligi bilityCrit eria.json" , @db) | |
| 66 | restor eCollectio n("custom- friendly-t ext", "var -utility", "facility _friendly_ name.json" , @db) | |
| 67 | delete PatientDat a(@@patien tID) | |
| 68 | @common.lo ginEndsOnH ome( pw_reda c t e d ) | |
| 69 | @commo n.selectAd dAppointme ntButton(" VA") | |
| 70 | @@time Slot = "10 :00" | |
| 71 | @clini c_friendly _name ="JP PRIMARY C ARE DR. CR EAMER" | |
| 72 | @locat ion = "BOS TON HCS VA MC" | |
| 73 | ## The clinic na me is diff in cdw v/ s mdws but in real w orld its s ame per Ch ris. We ma y need to update thi s test onc e clinic n ame | |
| 74 | # for details, l ist and ap pointment form is be ing pulled from same place | |
| 75 | @clini c = "BOPAC TB1" | |
| 76 | end | |
| 77 | ||
| 78 | after(:a ll) do | |
| 79 | @drive r.close | |
| 80 | end | |
| 81 | ||
| 82 | context 'AC#VAR-27 59|TC#VAR- 2765: New Appointmen t - Enter Details cr iteria | |
| 83 | AC#VAR-33 48|VAR-345 9: New App ointment/R equest - R outing Cri teria | |
| 84 | AC#VAR-34 85|TC#VAR- 3486: Vali date - Dyn amic Clini c list bas ed on the Facility a nd Type of Care sele cted. | |
| 85 | AC#VAR-35 05|TC#VAR- 3639: Pref erred date criteria' do | |
| 86 | ||
| 87 | it "Ve rify Appoi ntment Det ails form is loaded" do | |
| 88 | @new _appointme nt.selectT ypeOfCare( PRIMARY_CA RE) | |
| 89 | @new _appointme nt.selectS tate("523" ) | |
| 90 | @new _appointme nt.selectL ocation("5 23") | |
| 91 | @new _appointme nt.selectS chedulingM ethod("dir ect") | |
| 92 | expe ct(@new_ap pointment. appointmen t_details_ legend).to eq("Appoi ntment Det ails") | |
| 93 | end | |
| 94 | ||
| 95 | it "Mu lti State: should ve rify label s and opti ons on new appointme nt form" d o | |
| 96 | @new _appointme nt.selectC linic("32" ) | |
| 97 | ||
| 98 | expe cted_conte nt =[\ | |
| 99 | "* req uired fiel d", | |
| 100 | "Step 1: Type of Care", | |
| 101 | "The V A Appointm ents app s upports sc heduling s pecific ty pes of car e. If you do not fin d the care you need, please co ntact your facility for assist ance.", | |
| 102 | "* Sel ect the ty pe of care you need: ", | |
| 103 | "Selec t", | |
| 104 | "Prima ry Care", | |
| 105 | "Audio logy", | |
| 106 | "Expre ss Care", | |
| 107 | "Optom etry", | |
| 108 | "Outpa tient Ment al Health" , | |
| 109 | "Step 2: City, S tate", | |
| 110 | "* Cho ose the cl osest city and state for this appointmen t:", | |
| 111 | "Selec t", | |
| 112 | "Des M oines, IA" , | |
| 113 | "Iowa City, IA", | |
| 114 | "BOSTO N, MA", | |
| 115 | "Omaha , NE", | |
| 116 | "Step 3: Locatio n", | |
| 117 | "The f ollowing f acility lo cations su pport sche duling Pri mary Care appointmen ts through this app. If you ca nnot find the locati on you nee d, please visit the VA Facilit y Locator to contact the facil ity for as sistance." , | |
| 118 | "* Sel ect the lo cation you want to v isit:", | |
| 119 | "Selec t", | |
| 120 | "BOSTO N HCS VAMC (BOSTON, MA) - Your Primary C are Team", | |
| 121 | "BROCK TON VAMC ( BROCKTON, MA)", | |
| 122 | "QUINC Y (QUINCY, MA)", | |
| 123 | "Provi ders:", | |
| 124 | "Cream er, Kent", | |
| 125 | "Your Care Team (PACT)", | |
| 126 | "Your Care Team (PACT) for BOSTON HC S VAMC", | |
| 127 | "Step 4: Schedul ing Method ", | |
| 128 | "The l ocation yo u selected supports the follow ing schedu ling metho ds:", | |
| 129 | "* Sel ect a sche duling met hod:", | |
| 130 | "Sched ule Myself ", | |
| 131 | "Submi t a Reques t to VA Sc heduler", | |
| 132 | "Appoi ntment Det ails", | |
| 133 | "* Sel ect Clinic :", | |
| 134 | "BO PA CT B1", | |
| 135 | "JP PR IMARY CARE DR. CREAM ER", | |
| 136 | "BO PC C QUICK AC CESS AM 22 04", | |
| 137 | "Prima ry Care - No Time Sl ot", | |
| 138 | "If yo u don't se e the clin ic that ma tches your needs, co ntact your facility for assist ance.", | |
| 139 | "* Rea son for Ap pointment: ", | |
| 140 | "(150 char limit )", | |
| 141 | "150 c haracters remaining" , | |
| 142 | "* Pre ferred Dat e:", | |
| 143 | "Appoi ntments ma y be sched uled betwe en " + @to morrow + " and " +@n intyDaysLa ter+ ".", | |
| 144 | "Show Availabili ty", | |
| 145 | "Email Preferenc es", | |
| 146 | "Send me updates on my app ointments and reques ts:", | |
| 147 | "Infor mation abo ut updates on my app ointments and reques ts", | |
| 148 | "Yes", | |
| 149 | "No", | |
| 150 | "Sched ule Appoin tment Canc el"] | |
| 151 | ||
| 152 | ||
| 153 | actu al_content = @new_ap pointment. getScreenC ontent.spl it("\n") | |
| 154 | expe cted_conte nt.each_wi th_index d o | expect edScreenRo w, i | | |
| 155 | ex pect(expec tedScreenR ow.strip). to include (actual_co ntent[i].s trip) | |
| 156 | end | |
| 157 | ||
| 158 | end | |
| 159 | ||
| 160 | ||
| 161 | it "Sh ould verif y Multiple facility: Verify st atic text for multip le facilit ies" do | |
| 162 | #log in as a d iff user. if user ha s more the n one DFN, then disp lay a radi o button l ist of all facilitie s | |
| 163 | rest oreCollect ion("direc tBookingEl igibilityC riteria", "var-utili ty", "dire ctScheduli ngEnabled. json", @db ) | |
| 164 | rest oreCollect ion("reque stEligibil ityCriteri a", "var-u tility", " requestEli gibilityCr iteria.jso n", @db) | |
| 165 | @new _appointme nt.cancelF orm | |
| 166 | @common.lo goutAndLog backWithAD ifferentUs er( pw_reda c t e d ) | |
| 167 | @com mon.select AddAppoint mentButton ("VA") | |
| 168 | @new _appointme nt.selectT ypeOfCare( AUDIOLOGY) | |
| 169 | @new _appointme nt.selectS tate("523" ) | |
| 170 | ||
| 171 | expe cted_conte nt =[\ | |
| 172 | "Step 3: Locatio n", | |
| 173 | "The f ollowing f acility lo cations su pport sche duling #{A UDIOLOGY} appointmen ts through this app. If you ca nnot find the locati on you nee d, please visit the VA Facilit y Locator to contact the facil ity for as sistance." , | |
| 174 | "* Sel ect the lo cation you want to v isit:", | |
| 175 | "Selec t", | |
| 176 | "BOSTO N HCS VAMC (BOSTON, MA)", | |
| 177 | "BROCK TON VAMC ( BROCKTON, MA)", | |
| 178 | "QUINC Y (QUINCY, MA)" | |
| 179 | ] | |
| 180 | ||
| 181 | actu al_content = @new_ap pointment. facility_s ection_ele ment.text. split("\n" ) | |
| 182 | ||
| 183 | comp areContent s( expecte d_content, actual_co ntent) | |
| 184 | ||
| 185 | end | |
| 186 | ||
| 187 | it "Sh ould verif y Single c linic: Ver ify Single clinic la bel " do | |
| 188 | @new _appointme nt.selectT ypeOfCare( OPTOMETRY) | |
| 189 | @new _appointme nt.selectS tate("523" ) | |
| 190 | @new _appointme nt.selectL ocation("5 23") | |
| 191 | @new _appointme nt.selectS chedulingM ethod("dir ect") | |
| 192 | if ( @modal.isM odalPopUpP resent) | |
| 193 | @modal.but tons_eleme nts[0].cli ck | |
| 194 | @common.wa itWhileSpi nnerPresen t() | |
| 195 | sleep 2 | |
| 196 | end | |
| 197 | @new _appointme nt.single_ clinic_lab el_element .when_visi ble(TIME_O UT_LIMIT) | |
| 198 | expe ct(@new_ap pointment. single_cli nic_label) .to eq("Cl inic:") | |
| 199 | end | |
| 200 | ||
| 201 | it "sh ould verif y Single c linic: onl y single c linic disp layed with friendly name " do | |
| 202 | clin icInfo = [ "ZZPJH OPT OMETRY", " Test Optom etry"] | |
| 203 | actu alClinicIn fo = @new_ appointmen t.single_c linic_info _element.t ext.split( "\n") | |
| 204 | comp areContent s(clinicIn fo, actual ClinicInfo ) | |
| 205 | end | |
| 206 | ||
| 207 | it "sh ould verif y When cha nging faci lity, form nullifies all subse quent fiel ds" do | |
| 208 | @new _appointme nt.selectT ypeOfCare( PRIMARY_CA RE) | |
| 209 | @new _appointme nt.selectS tate("523" ) | |
| 210 | @new _appointme nt.selectL ocation("5 23") | |
| 211 | @new _appointme nt.selectS chedulingM ethod("dir ect") | |
| 212 | #whe n changing facility, it nullif ies all su bsequent f ields | |
| 213 | slee p 2 | |
| 214 | @new _appointme nt.selectL ocation("5 23A5") | |
| 215 | @com mon.waitWh ileSpinner Present() | |
| 216 | slee p 2 | |
| 217 | @new _appointme nt.type_of _care_elem ent.when_v isible(TIM E_OUT_LIMI T) | |
| 218 | expe ct(@new_ap pointment. scheduling _method_ra dio_elemen ts[0].sele cted?).to eq(false) | |
| 219 | end | |
| 220 | ||
| 221 | it "sh ould verif y Multiple clinic: V erify Mult iple clini cs label" do | |
| 222 | ||
| 223 | @new _appointme nt.selectT ypeOfCare( AUDIOLOGY) | |
| 224 | @new _appointme nt.selectS tate("523" ) | |
| 225 | @new _appointme nt.selectL ocation("5 23") | |
| 226 | @com mon.waitWh ileSpinner Present() | |
| 227 | @new _appointme nt.select_ scheduling _method_ra dio("direc t") | |
| 228 | @new _appointme nt.multi_c linic_labe l_element. when_prese nt(TIME_OU T_LIMIT) | |
| 229 | expe ct(@new_ap pointment. multi_clin ic_label). to eq("* S elect Clin ic:") | |
| 230 | ||
| 231 | end | |
| 232 | ||
| 233 | it "Mu ltiple cli nic: Verif y Multiple clinics d isplayed i n list" do | |
| 234 | ||
| 235 | clin icInfo1 = ["BO RHEUM DUBREUIL" , "Audiolo gy Clinic" ] | |
| 236 | clin icInfo2 = ["ZZBO LAN GUAGE PATH OLOGY GR"] | |
| 237 | ||
| 238 | ||
| 239 | clin icGroup1 = @new_appo intment.cl inic_group _elements[ 0].text.sp lit("\n") | |
| 240 | comp areContent s(clinicIn fo1, clini cGroup1) | |
| 241 | ||
| 242 | clin icGroup2 = @new_appo intment.cl inic_group _elements[ 1].text.sp lit("\n") | |
| 243 | comp areContent s(clinicIn fo2, clini cGroup2) | |
| 244 | ||
| 245 | end | |
| 246 | ||
| 247 | it "Ve rify Clini c field is required" do | |
| 248 | @new _appointme nt.clickSc heduleAppo intment | |
| 249 | veri fyErrorMes sage("Sele ct Clinic field is r equired.") | |
| 250 | ||
| 251 | end | |
| 252 | ||
| 253 | it "Ve rify Clini c can be s elected" d o | |
| 254 | ||
| 255 | @new _appointme nt.selectC linic("64" ) | |
| 256 | expe ct(@new_ap pointment. clinic_rad io_selecte d?).to eq( "64") | |
| 257 | expe ct(@new_ap pointment. clinic_rad io_element s[0].enabl ed?).to eq (true) | |
| 258 | expe ct(@new_ap pointment. clinic_rad io_element s[1].enabl ed?).to eq (true) | |
| 259 | end | |
| 260 | ||
| 261 | it "Ve rify selec ting clini c loads re ason for a ppointment option" d o | |
| 262 | @new _appointme nt.selectN ewAppointm entAndSche dule(PRIMA RY_CARE, " 523","523" , "direct" ) | |
| 263 | @new _appointme nt.selectC linic("32" ) | |
| 264 | @new _appointme nt.reason_ element.wh en_present (TIME_OUT_ LIMIT) | |
| 265 | @new _appointme nt.preferr ed_date_el ement.when _present(T IME_OUT_LI MIT) | |
| 266 | expe ct(@new_ap pointment. reason_ele ment.prese nt?).to eq (true) | |
| 267 | end | |
| 268 | ||
| 269 | it "Re ason for A ppointment is requir ed" do | |
| 270 | @new _appointme nt.clickSc heduleAppo intment | |
| 271 | veri fyErrorMes sage("Reas on for App ointment f ield is re quired.") | |
| 272 | ||
| 273 | end | |
| 274 | ||
| 275 | it "Ad ds Reason for Appoin tment: max imum chara cter can b e entered" do | |
| 276 | char 50 = "MaxC hars50MaxC hars50MaxC hars50MaxC hars50MaxC hars50" | |
| 277 | @new _appointme nt.reason = char50 | |
| 278 | #exp ect(@new_a ppointment .reason).t o eq(char5 0) | |
| 279 | @new _appointme nt.reason = char50 + char50 + char50 | |
| 280 | @new _appointme nt.reason_ element.fi re_event(' onblur') | |
| 281 | expe ct(@new_ap pointment. reason).to eq(char50 + char50 + char50) | |
| 282 | ||
| 283 | end | |
| 284 | ||
| 285 | it "Ve rify prefe rred date option is present" d o | |
| 286 | expe ct(@new_ap pointment. preferred_ date_eleme nt.present ?).to eq(t rue) | |
| 287 | end | |
| 288 | ||
| 289 | it "Ve rify Prefe rred date is require d" do | |
| 290 | @new _appointme nt.clickSc heduleAppo intment | |
| 291 | veri fyErrorMes sage("Pref erred Date field is required." ) | |
| 292 | end | |
| 293 | ||
| 294 | it "Ve rify Prefe rred date default me ssage" do | |
| 295 | ||
| 296 | expe ct(@new_ap pointment. preferred_ date_info_ text).to e q("Appoint ments may be schedul ed between " + @tomo rrow + " a nd " + @ni ntyDaysLat er + ".") | |
| 297 | ||
| 298 | end | |
| 299 | ||
| 300 | it "Ve rify Prefe rred date error mess age for ra nge" do | |
| 301 | @new _appointme nt.preferr ed_date = getDateNt hDaysFromN ow(0, "%m/ %d/%Y") | |
| 302 | @new _appointme nt.clickSc heduleAppo intment | |
| 303 | veri fyErrorMes sage("Plea se enter a date betw een " + @t omorrow + " and " + @nintyDays Later + ". ") | |
| 304 | end | |
| 305 | ||
| 306 | it "sh ould Verif y instruct ional text Showing a ll availab le dates." do | |
| 307 | @new _appointme nt.preferr ed_date = @sevenDay sFromNow | |
| 308 | @new _appointme nt.show_av ailability | |
| 309 | @new _appointme nt.show_al l_dates_el ement.when _present(T IME_OUT_LI MIT) | |
| 310 | @new _appointme nt.show_al l_dates | |
| 311 | expe ct(@new_ap pointment. select_dat etime_inst r_text).to eq("Showi ng all ava ilable dat es.") | |
| 312 | end | |
| 313 | ||
| 314 | it "Sh ould verif y date ele ment for 9 0 days lat er is pres ent" do | |
| 315 | expe ct(@new_ap pointment. isDateElem entPresent (getDateNt hDaysFromN ow(90, "%m /%d/%Y"))) .to eq(tru e) | |
| 316 | ||
| 317 | end | |
| 318 | ||
| 319 | it "sh ould verif y that no date eleme nt for mor e than 90 days is pr esent" do | |
| 320 | expe ct(@new_ap pointment. isDateElem entPresent (getDateNt hDaysFromN ow(91, "%m /%d/%Y"))) .to eq(fal se) | |
| 321 | end | |
| 322 | ||
| 323 | it "Se lect Date/ Time is re quired" do | |
| 324 | @new _appointme nt.schedul e_appointm ent | |
| 325 | veri fyErrorMes sage("Sele ct Date/Ti me field i s required .") | |
| 326 | =begin | |
| 327 | Wati r::Wait.un til { @new _appointme nt.isDateE lementPres ent(threeD aysLater)} | |
| 328 | #inf o text | |
| 329 | expe ct(@new_ap pointment. select_dat etime_inst r_text).to eq("Showi ng all ava ilable dat es.") | |
| 330 | ||
| 331 | #Feb ruary Expa nded, thre eDaysLater Expanded | |
| 332 | expe ct(@new_ap pointment. isElementC ollapsed( @new_appoi ntment.get MonthEleme nt( getMon thOfYear(t hreeDaysLa ter, "%B") , getYear( threeDaysL ater) ))). to eq(fals e) | |
| 333 | expe ct(@new_ap pointment. isElementC ollapsed( @new_appoi ntment.get DateElemen t(threeDay sLater))). to eq(fals e) | |
| 334 | expe ct(@new_ap pointment. getTimeSlo tElement(t hreeDaysLa ter, "09:0 0").visibl e?).to eq( true) | |
| 335 | ||
| 336 | expe ct(@new_ap pointment. getMonthEl ement( get MonthOfYea r(threeDay sLater, "% B"), getYe ar(threeDa ysLater) ) .text).to include("s elect to c ollapse co ntent") | |
| 337 | ||
| 338 | expe ct(@new_ap pointment. isElementC ollapsed( @new_appoi ntment.get DateElemen t(getDateN thDaysFrom Now(23, "% m/%d/%Y")) )).to eq(t rue) | |
| 339 | expe ct(@new_ap pointment. isElementC ollapsed( @new_appoi ntment.get DateElemen t(getDateN thDaysFrom Now(57, "% m/%d/%Y")) )).to eq(t rue) | |
| 340 | expe ct(@new_ap pointment. isElementC ollapsed( @new_appoi ntment.get DateElemen t(getDateN thDaysFrom Now(74, "% m/%d/%Y")) )).to eq(t rue) | |
| 341 | expe ct(@new_ap pointment. isElementC ollapsed( @new_appoi ntment.get DateElemen t(getDateN thDaysFrom Now(81, "% m/%d/%Y")) )).to eq(t rue) | |
| 342 | ||
| 343 | expe ct(@new_ap pointment. getDateEle ment(getDa teNthDaysF romNow(57, "%m/%d/%Y ")).text). to include ("select t o expand c ontent") | |
| 344 | ||
| 345 | #no matching d ate | |
| 346 | nint eenDaysLat er = getDa teNthDaysF romNow(19, "%m/%d/%Y ") | |
| 347 | @new _appointme nt.preferr ed_date = ninteenDay sLater | |
| 348 | @new _appointme nt.show_av ailability | |
| 349 | @new _appointme nt.show_al l_dates | |
| 350 | ||
| 351 | expe ct(@new_ap pointment. isDateElem entPresent (ninteenDa ysLater)). to eq(fals e) | |
| 352 | expe ct(@new_ap pointment. isAllDates Collapsed) .to eq(tru e) | |
| 353 | ||
| 354 | #tod ay + 90 da ys | |
| 355 | expe ct(@new_ap pointment. isDateElem entPresent (@nintyDay sLater)).t o eq(true) | |
| 356 | expe ct(@new_ap pointment. isDateElem entPresent (getDateNt hDaysFromN ow(91, "%m /%d/%Y"))) .to eq(fal se) | |
| 357 | ||
| 358 | #cle ar preferr ed date | |
| 359 | @new _appointme nt.preferr ed_date = "" | |
| 360 | @new _appointme nt.preferr ed_date_el ement.send _keys :ent er | |
| 361 | Wati r::Wait.un til { @ne w_appointm ent.show_a vailabilit y_element. enabled? = = false} | |
| 362 | #sel ect date/t ime field becomes hi dden | |
| 363 | expe ct(@new_ap pointment. show_avail ability_el ement.enab led?).to e q(false) | |
| 364 | ||
| 365 | fift ySevenDays Later = ge tDateNthDa ysFromNow( 57, "%m/%d /%Y") | |
| 366 | @new _appointme nt.preferr ed_date = fiftySeven DaysLater | |
| 367 | @new _appointme nt.show_av ailability | |
| 368 | @new _appointme nt.show_al l_dates | |
| 369 | ||
| 370 | Wati r::Wait.un til { @new _appointme nt.isDateE lementPres ent(fiftyS evenDaysLa ter)} | |
| 371 | ||
| 372 | expe ct(@new_ap pointment. isAllDates Collapsed) .to eq(fal se) | |
| 373 | expe ct(@new_ap pointment. isElementC ollapsed( @new_appoi ntment.get MonthEleme nt( getMon thOfYear(f iftySevenD aysLater, "%B"), get Year(fifty SevenDaysL ater) ))). to eq(fals e) | |
| 374 | expe ct(@new_ap pointment. isElementC ollapsed( @new_appoi ntment.get DateElemen t(fiftySev enDaysLate r))).to eq (false) | |
| 375 | expe ct(@new_ap pointment. getTimeSlo tElement(f iftySevenD aysLater, "08:00").v isible?).t o eq(true) | |
| 376 | expe ct(@new_ap pointment. getTimeSlo tElement(f iftySevenD aysLater, "10:00").v isible?).t o eq(true) | |
| 377 | expe ct(@new_ap pointment. getTimeSlo tElement(f iftySevenD aysLater, "10:30").v isible?).t o eq(true) | |
| 378 | expe ct(@new_ap pointment. getTimeSlo tElement(f iftySevenD aysLater, "13:30").v isible?).t o eq(true) | |
| 379 | ||
| 380 | @new _appointme nt.schedul e_appointm ent | |
| 381 | veri fyErrorMes sage("Sele ct Date/Ti me field i s required .") | |
| 382 | ||
| 383 | @new _appointme nt.selectT imeSlot(fi ftySevenDa ysLater, " 10:30") | |
| 384 | expe ct(@new_ap pointment. selected_d atetime_in fo_label + " " + @ne w_appointm ent.select ed_datetim e_info).to eq("You a re schedul ing an app ointment f or: " + ge tDayofWeek (fiftySeve nDaysLater ) + ", " + fiftySeven DaysLater + " 10:30" ) | |
| 385 | end | |
| 386 | =end | |
| 387 | end | |
| 388 | ||
| 389 | it "Sh ould verif y month an d preferre d date slo t is expan ded" do | |
| 390 | expe ct(@new_ap pointment. isElementC ollapsed( @new_appoi ntment.get MonthEleme nt( getMon thOfYear(@ sevenDaysF romNow, "% B"), getYe ar(@sevenD aysFromNow ) ))).to e q(false) | |
| 391 | expe ct(@new_ap pointment. isElementC ollapsed( @new_appoi ntment.get DateElemen t(@sevenDa ysFromNow) )).to eq(f alse) | |
| 392 | expe ct(@new_ap pointment. getTimeSlo tElement(@ sevenDaysF romNow, @@ timeSlot). visible?). to eq(true ) | |
| 393 | end | |
| 394 | ||
| 395 | it "Sh ould verif y select t o collapse content i nstrution" do | |
| 396 | expe ct(@new_ap pointment. getMonthEl ement( get MonthOfYea r(@sevenDa ysFromNow, "%B"), ge tYear(@sev enDaysFrom Now) ).tex t).to incl ude("selec t to colla pse conten t") | |
| 397 | end | |
| 398 | ||
| 399 | it "Sh ould verif y select t o expand c ontent ins truction" do | |
| 400 | expe ct(@new_ap pointment. getDateEle ment(getDa teNthDaysF romNow(57, "%m/%d/%Y ")).text). to include ("select t o expand c ontent") | |
| 401 | ||
| 402 | end | |
| 403 | ||
| 404 | it "sh ould Verif y clearein g preferre d dates hi des the sh ow availab ilty selec tion" do | |
| 405 | @new _appointme nt.preferr ed_date = "" | |
| 406 | @new _appointme nt.preferr ed_date_el ement.send _keys :ent er | |
| 407 | Wati r::Wait.un til { @ne w_appointm ent.show_a vailabilit y_element. enabled? = = false} | |
| 408 | #sel ect date/t ime field becomes hi dden | |
| 409 | expe ct(@new_ap pointment. show_avail ability_el ement.enab led?).to e q(false) | |
| 410 | end | |
| 411 | ||
| 412 | it "sh ould selec t preferre d date" do | |
| 413 | @new _appointme nt.selectP referedDat e(@sevenDa ysFromNow, @@timeSlo t) | |
| 414 | @@se tDate = Ne wAppointme ntRequest. bookedDate | |
| 415 | end | |
| 416 | ||
| 417 | it "Sh ould verif y the slot selection " do | |
| 418 | expe ct(@new_ap pointment. selected_d atetime_in fo_label + " " + @ne w_appointm ent.select ed_datetim e_info).to eq("You a re schedul ing an app ointment f or: " + ge tDayofWeek (@@setDate ) + ", " + @@setDate + " #{@@ti meSlot}") | |
| 419 | end | |
| 420 | ||
| 421 | it "sh ould Valid ate Email Preference and Submi t" do | |
| 422 | @new _appointme nt.select_ emailPref( "true") | |
| 423 | expe ct(@new_ap pointment. emailPref_ elements[0 ].selected ?).to eq(t rue) | |
| 424 | expe ct(@new_ap pointment. emailPref_ elements[1 ].selected ?).to eq(f alse) | |
| 425 | end | |
| 426 | ||
| 427 | it "Va lidate Ema il field i s required " do | |
| 428 | @new _appointme nt.email = "" | |
| 429 | @new _appointme nt.clickSc heduleAppo intment | |
| 430 | veri fyErrorMes sage("Emai l field is required. ") | |
| 431 | end | |
| 432 | ||
| 433 | it "sh ould verif y Schedule appointme nt is succ essfull" d o | |
| 434 | @new _appointme nt.email = "patient5 1@test.com " | |
| 435 | @new _appointme nt.email_e lement.fir e_event('o nblur') | |
| 436 | @new _appointme nt.clickSc heduleAppo intment | |
| 437 | @det ail.appoin tment_deta ils_group_ element.wh en_present (TIME_OUT_ LIMIT) | |
| 438 | expe ct(@detail .primary_h eader).to eq("Appoin tment Deta ils") | |
| 439 | end | |
| 440 | ||
| 441 | it "Sh ould verif y Appointm ent Detail s status i s schedule d" do | |
| 442 | #sta tus | |
| 443 | Wati r::Wait.un til {@deta il.appoint ment_detai ls_group_e lement.pre sent?} | |
| 444 | Wati r::Wait.un til {@deta il.appoint ment_detai ls_group_e lement.tex t.include? ("Reason f or Appoint ment")} | |
| 445 | expe ct(@detail .appointme nt_status_ group_elem ent.text). to eq("Sta tus: Sche duled") | |
| 446 | end | |
| 447 | ||
| 448 | it "Sh ould verif y Provide Feedback l ink is dis played on Submission Confirmat ion page" do | |
| 449 | expe ct(@detail .feedbackL ink_elemen t.text).to eq("Provi de feedbac k on this submission .") | |
| 450 | end | |
| 451 | ||
| 452 | it "Sh ould verif y appointm ent detail s for date /time, cli nic and Re ason for A ppointment " do | |
| 453 | @@se lectedDay = getDayof Week(@@set Date) | |
| 454 | @@ti meSlot = @ @timeSlot. gsub!(':', '') | |
| 455 | expe cted_text = [\ | |
| 456 | "Date and Time:" + " #{@@selec tedDay}," + " #{@@se tDate}", | |
| 457 | "Date:" + " #{@@sele ctedDay}," + " #{@@se tDate}", | |
| 458 | @@timeSlot , | |
| 459 | "Time: #{@ @timeSlot. gsub("", " ")}", | |
| 460 | "Add to Ca lendar", | |
| 461 | "Details: " + "#{@lo cation}", | |
| 462 | "#{@clinic _friendly_ name}", | |
| 463 | "Also call ed: #{@cli nic}", | |
| 464 | "Please ar rive 30 mi nutes befo re your sc heduled ti me unless otherwise directed. VA Facilit y Locator" , | |
| 465 | "Cancel Ap pointment" , | |
| 466 | "Reason fo r Appointm ent: MaxCh ars50MaxCh ars50MaxCh ars50MaxCh ars50MaxCh ars50MaxCh ars50MaxCh ars50MaxCh ars50MaxCh ars50MaxCh ars50MaxCh ars50MaxCh ars50MaxCh ars50MaxCh ars50MaxCh ars50" | |
| 467 | ] | |
| 468 | actu al_text = @detail.ap pointment_ details_gr oup_elemen t.text.spl it("\n") | |
| 469 | actu al_text = actual_tex t.reject { |c| c.emp ty? } | |
| 470 | expe cted_text. each_with_ index do | expectedS creenRow, i | | |
| 471 | ex pect(actua l_text[i]. gsub(/\s+/ , '')).to eq(expecte dScreenRow .gsub(/\s+ /, '')) | |
| 472 | end | |
| 473 | end | |
| 474 | ||
| 475 | it "Em ail DB Val idation" d o | |
| 476 | emai lId = exec uteAndGetD ataAndNumR ow("SELECT EMAIL_ADD RESS FROM VARDB.NOTI FICATION_P REFERENCE WHERE PATI ENT_ID = ' #{@@patien tID}'") | |
| 477 | emai lArr = ema ilId.split ("||") | |
| 478 | expe ct(emailAr r[0]).to e q("patient 51@test.co m") | |
| 479 | end | |
| 480 | ||
| 481 | it "sh ould click on Feedba ck link an d submit f eedback" d o | |
| 482 | @det ail.feedba ckLink | |
| 483 | @fee dback.sele ctFeedback ondefullfo rm("5") | |
| 484 | @fee dback.feed back_comme nt="This i s a Test" | |
| 485 | @fee dback.feed back_submi t | |
| 486 | @lan ding_appoi ntments.pr imary_head er_element .when_pres ent(TIME_O UT_LIMIT) | |
| 487 | @com mon.waitWh ileSpinner Present | |
| 488 | expe ct(@feedba ck.thanks_ msg_elemen t.text).to eq("Thank you! Your feedback has been s ubmitted." ) | |
| 489 | end | |
| 490 | ||
| 491 | it "sh ould verif y User has been navi gated back to Appoin tment/Requ est landin g page" do | |
| 492 | butt on_element = @driver .button(:i d => 'back -btn') | |
| 493 | @dri ver.execut e_script(" $(argument s[0]).clic k();",butt on_element ) | |
| 494 | @lan ding_appoi ntments.ap pointment_ header_ele ment.when_ present(TI ME_OUT_LIM IT) | |
| 495 | expe ct(@landin g_appointm ents.has_e xpected_ti tle?).to e q(true) | |
| 496 | end | |
| 497 | ||
| 498 | end | |
| 499 | ||
| 500 | end | |
| 501 | ||
| 502 | ||
| 503 | ||
| 504 | ||
| 505 | ||
| 506 | ||
| 507 | ||
| 508 |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.