Produced by Araxis Merge on 12/7/2018 11:36:07 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\archived | calendar_picker.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\archived | calendar_picker.rb | Fri Dec 7 13:25:50 2018 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 586 |
| 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 | 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 '.. /../pages/ landing_ap pointments ' | |
| 16 | require_re lative '.. /../pages/ appointmen ts/new_app ointment_r equest' | |
| 17 | require_re lative '.. /../helper /modal' | |
| 18 | require_re lative '.. /../module /database/ OracleUtil ity' | |
| 19 | require_re lative '.. /../module /DateUtili ty' | |
| 20 | require_re lative '.. /../helper /error_val idation' | |
| 21 | require_re lative '.. /../helper /calendar_ picker' | |
| 22 | ||
| 23 | describe ' [Story#VAR -1580: Cal endar pick er (Non-fu nctional s tory)]' do | |
| 24 | include DriverUtil ity | |
| 25 | include OracleUtil ity | |
| 26 | include DateUtilit y | |
| 27 | ||
| 28 | before(: all) do | |
| 29 | initia lizeConfig urations(V AR_BASE_UR L) | |
| 30 | @landi ng_appoint ments = La ndingAppoi ntments.ne w(@driver) | |
| 31 | @login = Login.n ew(@driver ) | |
| 32 | @eula = Eula.new (@driver) | |
| 33 | @commo n = Common .new(@driv er) | |
| 34 | @modal = Modal.n ew(@driver ) | |
| 35 | @new_r equest = N ewAppointm entRequest .new(@driv er) | |
| 36 | @error = Error_V alidation. new(@drive r) | |
| 37 | @calen dar = Cale ndarPicker .new(@driv er) | |
| 38 | ||
| 39 | APPOIN TMENTS = " Appointmen ts/Request s" | |
| 40 | ||
| 41 | @today = getDate NthDaysAgo (0, "%m/%d /%Y") | |
| 42 | @three MonthAgo = getDateNt hMonthsFro mNow(-3, " %m/%d/%Y") | |
| 43 | @yeste rday = get DateNthDay sFromNow(- 1,"%m/%d/% Y") | |
| 44 | @fiveD aysLater = getDateNt hDaysFromN ow(5, "%m/ %d/%Y") | |
| 45 | ||
| 46 | delete PatientDat a("D123401 ") | |
| 47 | ||
| 48 | end | |
| 49 | ||
| 50 | after(:a ll) do | |
| 51 | @drive r.close | |
| 52 | end | |
| 53 | ||
| 54 | context "AC: Imple ment Calen dar Date P icker for Date Field s" do | |
| 55 | xit ". A calenda r picker c ontrol is available for date e ntry field s " do | |
| 56 | @common.lo ginEndsOnH ome( pw_reda c t e d ) | |
| 57 | ||
| 58 | @lan ding_appoi ntments.pr imary_head er_element .when_pres ent(TIME_O UT_LIMIT) | |
| 59 | expe ct(@landin g_appointm ents.prima ry_header) .to eq(APP OINTMENTS) | |
| 60 | ||
| 61 | @com mon.waitWh ileSpinner Present | |
| 62 | ||
| 63 | Wati r::Wait.un til {@land ing_appoin tments.add _top_btn_e lement.pre sent?} | |
| 64 | @lan ding_appoi ntments.ad d_top_btn_ element.wh en_present | |
| 65 | ||
| 66 | @lan ding_appoi ntments.ad d_top_btn | |
| 67 | @com mon.waitWh ileSpinner Present | |
| 68 | expe ct(@new_re quest.has_ expected_t itle?).to eq(true) | |
| 69 | ||
| 70 | Wati r::Wait.un til { @new _request.f acility_ra dio_elemen ts[1].pres ent? } | |
| 71 | ||
| 72 | @new _request.s elect_faci lity_radio ("650") | |
| 73 | @com mon.waitWh ileSpinner Present | |
| 74 | @new _request.t ype_of_car e = "PRIMA RY CARE" | |
| 75 | @com mon.waitWh ileSpinner Present | |
| 76 | ||
| 77 | @new _request.s cheduling_ method_rad io_element s[1].when_ visible(TI ME_OUT_LIM IT) | |
| 78 | expe ct(@new_re quest.sche duling_met hod_radio_ elements[1 ].enabled? ).to eq(tr ue) | |
| 79 | @new _request.s elect_sche duling_met hod_radio( "clerk") | |
| 80 | ||
| 81 | #cal endar cont rol visibl e | |
| 82 | @new _request.o ption_date 1_element. when_prese nt(TIME_OU T_LIMIT) | |
| 83 | expe ct(@new_re quest.opti on_date_ca lendar1_el ement.pres ent?).to e q(true) | |
| 84 | ||
| 85 | end | |
| 86 | ||
| 87 | xit ". When a us er selects the calen dar picker , a calend ar view ap pears. " d o | |
| 88 | @new _request.o ption_date _calendar1 _element.c lick | |
| 89 | expe ct(@calend ar.isCalen darDisplay ed).to eq( true) | |
| 90 | end | |
| 91 | ||
| 92 | xit ". When the calendar p icker is s elected, t he calenda r opens in side the a ctive scre en or moda l, keeping the origi nating scr een in vie w." do | |
| 93 | #man ual testin g | |
| 94 | end | |
| 95 | ||
| 96 | ||
| 97 | xit ". Users can advance t he calenda r picker o ne month a t a time w ithin the available date range constrain ts." do | |
| 98 | #sel ected date is five d ays later | |
| 99 | expe ct(getMont hOfYear(@f iveDaysLat er, "%B") + " " + g etYear(@fi veDaysLate r)).to eq( @calendar. getTitleTo ggleButton Text) | |
| 100 | ||
| 101 | next MonthAndYe ar = getNt hMonthFrom GivenDate( @fiveDaysL ater, 1) | |
| 102 | ||
| 103 | @cal endar.clic kNextButto n | |
| 104 | Wati r::Wait.un til {nextM onthAndYea r == @cale ndar.getTi tleToggleB uttonText} | |
| 105 | expe ct(@calend ar.getTitl eToggleBut tonText).t o eq(nextM onthAndYea r) | |
| 106 | ||
| 107 | next MonthAndYe ar = getNt hMonthFrom GivenDate( @fiveDaysL ater, 2) | |
| 108 | @cal endar.clic kNextButto n | |
| 109 | Wati r::Wait.un til {nextM onthAndYea r == @cale ndar.getTi tleToggleB uttonText} | |
| 110 | expe ct(@calend ar.getTitl eToggleBut tonText).t o eq(nextM onthAndYea r) | |
| 111 | ||
| 112 | prev iousMonthA ndYear = g etNthMonth FromGivenD ate(@fiveD aysLater, 1) | |
| 113 | @cal endar.clic kPreviousB utton | |
| 114 | Wati r::Wait.un til {previ ousMonthAn dYear == @ calendar.g etTitleTog gleButtonT ext} | |
| 115 | expe ct(@calend ar.getTitl eToggleBut tonText).t o eq(previ ousMonthAn dYear) | |
| 116 | ||
| 117 | prev iousMonthA ndYear = g etNthMonth FromGivenD ate(@fiveD aysLater, 0) | |
| 118 | @cal endar.clic kPreviousB utton | |
| 119 | Wati r::Wait.un til {previ ousMonthAn dYear == @ calendar.g etTitleTog gleButtonT ext} | |
| 120 | expe ct(@calend ar.getTitl eToggleBut tonText).t o eq(previ ousMonthAn dYear) | |
| 121 | ||
| 122 | end | |
| 123 | ||
| 124 | xit ". Users can advance t he calenda r picker o ne year at a time wi thin the a vailable d ate range constraint s." do | |
| 125 | #cli ck Header button | |
| 126 | @cal endar.clic kTitleTogg leButton | |
| 127 | year = @calend ar.getTitl eToggleBut tonText | |
| 128 | ||
| 129 | Wati r::Wait.un til {getYe ar(@today) == year} | |
| 130 | expe ct(@calend ar.getTitl eToggleBut tonText).t o eq(getYe ar(@fiveDa ysLater)) | |
| 131 | ||
| 132 | Mont hAfter90Da ys = getMo nthOfYear( getDateNth DaysFromNo w(90, "%m/ %d/%Y"), " %B") | |
| 133 | Mont hAfter130D ays = getM onthOfYear (getDateNt hDaysFromN ow(130, "% m/%d/%Y"), "%B") | |
| 134 | ||
| 135 | #exp ect(@calen dar.isMont hOrYearEna bled(Month After90Day s[0..2])). to eq(true ) | |
| 136 | #exp ect(@calen dar.isMont hOrYearEna bled(Month After130Da ys[0..2])) .to eq(fal se) | |
| 137 | ||
| 138 | #if month is e nabled, th en the nex t button i s disabled | |
| 139 | #if( @calendar. isMonthOrY earEnabled (MonthAfte r90Days[0. .2])) | |
| 140 | # e xpect(@cal endar.isNe xtButtonVi sible).to eq(false) | |
| 141 | #els e | |
| 142 | # e xpect(@cal endar.isNe xtButtonVi sible).to eq(true) | |
| 143 | #end | |
| 144 | ||
| 145 | expe ct(@calend ar.areAllM onthsDispl ayed).to e q(true) | |
| 146 | end | |
| 147 | ||
| 148 | ||
| 149 | xit ". Users ca n select a day on th e calendar ." do | |
| 150 | #mov e to calen dar view | |
| 151 | mont h = getMon thOfYear(@ fiveDaysLa ter, "%b") | |
| 152 | @cal endar.pick Month(mont h) | |
| 153 | Wati r::Wait.un til {getMo nthOfYear( @fiveDaysL ater, "%B" ) + " " + getYear(@ fiveDaysLa ter) == @c alendar.ge tTitleTogg leButtonTe xt} | |
| 154 | expe ct(getMont hOfYear(@f iveDaysLat er, "%B") + " " + g etYear(@fi veDaysLate r)).to eq( @calendar. getTitleTo ggleButton Text) | |
| 155 | ||
| 156 | twen tyDaysLate r = getDat eNthDaysFr omNow(20, "%m/%d/%Y" ) | |
| 157 | puts "Twenty d ays later is " + tw entyDaysLa ter.to_s | |
| 158 | ||
| 159 | if ( getMonthOf Year(@five DaysLater, "%b") != getMonthOf Year(twent yDaysLater , "%b") ) | |
| 160 | ne xtMonthAnd Year = get NthMonthFr omGivenDat e(@fiveDay sLater, 1) | |
| 161 | @c alendar.cl ickNextBut ton | |
| 162 | Wa tir::Wait. until {nex tMonthAndY ear == @ca lendar.get TitleToggl eButtonTex t} | |
| 163 | ex pect(@cale ndar.getTi tleToggleB uttonText) .to eq(nex tMonthAndY ear) | |
| 164 | end | |
| 165 | ||
| 166 | dayS tr = getDa y(twentyDa ysLater) | |
| 167 | puts "Day Stri ng: " + da yStr.to_s | |
| 168 | @cal endar.pick Day(dayStr ) | |
| 169 | Wati r::Wait.un til {@new_ request.op tion_date1 == twenty DaysLater} | |
| 170 | expe ct(@new_re quest.opti on_date1). to eq(twen tyDaysLate r) | |
| 171 | ||
| 172 | @new _request.o ption_date 1_element. click | |
| 173 | @new _request.o ption_date _calendar1 _element.c lick | |
| 174 | expe ct(@calend ar.isCalen darDisplay ed).to eq( true) | |
| 175 | fort yDaysLater = getDate NthDaysFro mNow(40,"% m/%d/%Y") | |
| 176 | @cal endar.pick (fortyDays Later) | |
| 177 | Wati r::Wait.un til {@new_ request.op tion_date1 == fortyD aysLater} | |
| 178 | expe ct(@new_re quest.opti on_date1). to eq(fort yDaysLater ) | |
| 179 | ||
| 180 | @new _request.o ption_date 2_element. click | |
| 181 | @new _request.o ption_date _calendar2 _element.c lick | |
| 182 | expe ct(@calend ar.isCalen darDisplay ed).to eq( true) | |
| 183 | thir tyTwoDaysL ater = get DateNthDay sFromNow(3 2,"%m/%d/% Y") | |
| 184 | @cal endar.pick (thirtyTwo DaysLater) | |
| 185 | Wati r::Wait.un til {@new_ request.op tion_date2 == thirty TwoDaysLat er} | |
| 186 | expe ct(@new_re quest.opti on_date2). to eq(thir tyTwoDaysL ater) | |
| 187 | ||
| 188 | end | |
| 189 | ||
| 190 | xit ". Text box entries an d calendar picker en tries are kept in sy nch" do | |
| 191 | #cli ck other e lement to close the calendar. | |
| 192 | @new _request.o ption_date 1_element. click | |
| 193 | ||
| 194 | thir tyTwoDaysL ater = get DateNthDay sFromNow(3 2,"%m/%d/% Y") | |
| 195 | ||
| 196 | @new _request.o ption_date _calendar2 _element.c lick | |
| 197 | expe ct(@calend ar.isCalen darDisplay ed).to eq( true) | |
| 198 | @new _request.o ption_date 2 = thirty TwoDaysLat er | |
| 199 | @new _request.o ption_date _calendar2 _element.c lick | |
| 200 | expe ct(@calend ar.isCalen darDisplay ed).to eq( true) | |
| 201 | ||
| 202 | expe ct(@calend ar.getcurr entYear()) .to eq(get Year(thirt yTwoDaysLa ter)) | |
| 203 | expe ct(@calend ar.getCurr entMonth). to eq(getM onthOfYear (thirtyTwo DaysLater, "%B")) | |
| 204 | ||
| 205 | puts "current date " + @calendar. getCurrent Day | |
| 206 | puts "getday " + getDay( thirtyTwoD aysLater) | |
| 207 | expe ct(@calend ar.getCurr entDay()). to eq(getD ay(thirtyT woDaysLate r)) | |
| 208 | end | |
| 209 | ||
| 210 | xit ". This cale ndar contr ol is not optimized for screen readers. Please dir ectly ente r dates in the text box provid ed. Open c alendar co ntrol." do | |
| 211 | expe ct(@new_re quest.opti on_date_ca lendar1_el ement.attr ibute("ari a-label")) .to eq("Th is calenda r control is not opt imized for screen re aders. Ple ase direct ly enter d ates in th e text box provided. Open cale ndar contr ol.") | |
| 212 | expe ct(@new_re quest.opti on_date_ca lendar2_el ement.attr ibute("ari a-label")) .to eq("Th is calenda r control is not opt imized for screen re aders. Ple ase direct ly enter d ates in th e text box provided. Open cale ndar contr ol.") | |
| 213 | expe ct(@new_re quest.opti on_date_ca lendar3_el ement.attr ibute("ari a-label")) .to eq("Th is calenda r control is not opt imized for screen re aders. Ple ase direct ly enter d ates in th e text box provided. Open cale ndar contr ol.") | |
| 214 | end | |
| 215 | ||
| 216 | xit ". To ensure an equiva lent exper ience, the day assoc iated with the selec ted date s hall be ma de availab le to voic e over use rs as a te xt element shown bel ow the dat e text ent ry field." do | |
| 217 | #mak e sure day of the we ek populat ed for opt ion date3 .. clickin g other el ement | |
| 218 | @new _request.o ption_date 2_element. click | |
| 219 | ||
| 220 | thir tyTwoDaysL ater = get DateNthDay sFromNow(3 2, "%m/%d/ %Y") | |
| 221 | expe ct(@new_re quest.opti onDate2_da y.split("\ n")[1]).to eq(getDay ofWeek(thi rtyTwoDays Later)) | |
| 222 | puts "Day of t he week " + @new_req uest.optio nDate2_day | |
| 223 | ||
| 224 | end | |
| 225 | ||
| 226 | xit ". Date rang e constrai nts can be applied t o the cale ndar picke r so that excluded d ate values are not s electable. " do | |
| 227 | @new _request.o ption_date 3_element. click | |
| 228 | @new _request.o ption_date _calendar3 _element.c lick | |
| 229 | expe ct(@calend ar.isCalen darDisplay ed).to eq( true) | |
| 230 | eigh tyNineDays Later = ge tDateNthDa ysFromNow( 89,"%m/%d/ %Y") | |
| 231 | @cal endar.pick (eightyNin eDaysLater ) | |
| 232 | Wati r::Wait.un til {@new_ request.op tion_date3 == eighty NineDaysLa ter} | |
| 233 | expe ct(@new_re quest.opti on_date3). to eq(eigh tyNineDays Later) | |
| 234 | ||
| 235 | @new _request.o ption_date 3 = "" | |
| 236 | @new _request.o ption_date 3_element. click | |
| 237 | @new _request.o ption_date _calendar3 _element.c lick | |
| 238 | expe ct(@calend ar.isCalen darDisplay ed).to eq( true) | |
| 239 | tomo rrow = get DateNthDay sFromNow(1 ,"%m/%d/%Y ") | |
| 240 | ||
| 241 | @cal endar.flip ToYear(get Year(tomor row)) | |
| 242 | if(@ calendar.i sMonthOrYe arEnabled( getMonthOf Year(tomor row, "%b") )) | |
| 243 | @c alendar.pi ckMonth(ge tMonthOfYe ar(tomorro w, "%b")) | |
| 244 | ex pect(@cale ndar.isDay Enabled(ge tDay(tomor row))).to eq(false) | |
| 245 | else | |
| 246 | ex pect(@cale ndar.isMon thOrYearEn abled(getM onthOfYear (tomorrow, "%b"))).t o eq(false ) | |
| 247 | @c alendar.pi ckMonth(ge tMonthOfYe ar(@fiveDa ysLater, " %b")) | |
| 248 | end | |
| 249 | ||
| 250 | expe ct(@new_re quest.opti on_date3). to eq("") | |
| 251 | ||
| 252 | four DaysLater = getDateN thDaysFrom Now(4,"%m/ %d/%Y") | |
| 253 | @cal endar.flip ToYear(get Year(fourD aysLater)) | |
| 254 | if(@ calendar.i sMonthOrYe arEnabled( getMonthOf Year(fourD aysLater, "%b"))) | |
| 255 | @c alendar.pi ckMonth(ge tMonthOfYe ar(fourDay sLater, "% b")) | |
| 256 | ex pect(@cale ndar.isDay Enabled(ge tDay(fourD aysLater)) ).to eq(fa lse) | |
| 257 | else | |
| 258 | ex pect(@cale ndar.isMon thOrYearEn abled(getM onthOfYear (fourDaysL ater, "%b" ))).to eq( false) | |
| 259 | @c alendar.pi ckMonth(ge tMonthOfYe ar(@fiveDa ysLater, " %b")) | |
| 260 | end | |
| 261 | ||
| 262 | expe ct(@new_re quest.opti on_date3). to eq("") | |
| 263 | ||
| 264 | five DaysLater =getDateNt hDaysFromN ow(5,"%m/% d/%Y") | |
| 265 | @cal endar.pick (fiveDaysL ater) | |
| 266 | expe ct(@new_re quest.opti on_date3). to eq(five DaysLater) | |
| 267 | ||
| 268 | @new _request.o ption_date 3 = "" | |
| 269 | @new _request.o ption_date _calendar3 _element.c lick | |
| 270 | ||
| 271 | eigh tNineDaysL ater =getD ateNthDays FromNow(89 ,"%m/%d/%Y ") | |
| 272 | @cal endar.pick (eightNine DaysLater) | |
| 273 | # exp ect(@calen dar.isDayE nabled(get Day(eightN ineDaysLat er))).to e q(true) | |
| 274 | expe ct(@new_re quest.opti on_date3). to eq(eigh tNineDaysL ater) | |
| 275 | ||
| 276 | @new _request.o ption_date 3 = "" | |
| 277 | @new _request.o ption_date _calendar3 _element.c lick | |
| 278 | ||
| 279 | nine tyOneDaysL ater =getD ateNthDays FromNow(91 ,"%m/%d/%Y ") | |
| 280 | @cal endar.flip ToYear(get Year(ninet yOneDaysLa ter)) | |
| 281 | if(@ calendar.i sMonthOrYe arEnabled( getMonthOf Year(ninet yOneDaysLa ter, "%b") )) | |
| 282 | @c alendar.pi ckMonth(ge tMonthOfYe ar(ninetyO neDaysLate r, "%b")) | |
| 283 | ex pect(@cale ndar.isDay Enabled(ge tDay(ninet yOneDaysLa ter))).to eq(false) | |
| 284 | else | |
| 285 | ex pect(@cale ndar.isMon thOrYearEn abled(getM onthOfYear (ninetyOne DaysLater, "%b"))).t o eq(false ) | |
| 286 | @c alendar.pi ckMonth(ge tMonthOfYe ar(@fiveDa ysLater, " %b")) | |
| 287 | end | |
| 288 | ||
| 289 | expe ct(@new_re quest.opti on_date3). to eq("") | |
| 290 | end | |
| 291 | ||
| 292 | ||
| 293 | end | |
| 294 | end |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.