292. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 12/7/2018 11:36:08 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.

292.1 Files compared

# 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\requests add_new_request_and_details_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\requests add_new_request_and_details_spec.rb Fri Dec 7 13:26:00 2018 UTC

292.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 2 1508
Changed 1 2
Inserted 0 0
Removed 0 0

292.3 Comparison options

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

292.4 Active regular expressions

No regular expressions were active.

292.5 Comparison detail

  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 're quest_help er'
  12   require_re lative '.. /../pages/ landing'
  13   require_re lative '.. /../pages/ login'
  14   require_re lative '.. /../pages/ eula'
  15   require_re lative '.. /../common /common'
  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/request _appointme nt_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  
  26  
  27   describe ' [Story #VA R-1943: Ne w Request  - Enter De tails]
  28              [Story #VA R-2399: Ne w Request  - Email Pr eferences]
  29              [Story #VA R-1945: Ne w Request  - Submissi on/Cancel  Entry]
  30              [Story #VA R-4075: Re quest - De sired Date  - Label C hange]
  31              [Story #VA R-4361: Re quest Deta ils - REvi se to grou p fields r elated to  communicat ing with a  clerk (HF E recommen dation)]
  32              [Story #VA R-12535: R eintroduce  feedback  page on re quest work flow]
  33              [Story #VA R-12582: F eedback fo rm - updat e to suppo rt request s using Ne t Promoter  Score con trol]
  34              [Story # V AR-7833: S ubmit Requ est - Save  to reques t db' do
  35     include  OracleUtil ity
  36     include  DateUtilit y
  37     include  DriverUtil ity
  38     include  MongoUtili ty
  39  
  40     before(: all) do
  41       initia lizeConfig urations(V AR_BASE_UR L)
  42       @landi ng_appoint ments = La ndingAppoi ntments.ne w(@driver)
  43       @login  = Login.n ew(@driver )
  44       @eula  = Eula.new (@driver)
  45       @commo n = Common .new(@driv er)
  46       @modal  = Modal.n ew(@driver )
  47       @new_r equest = N ewAppointm entRequest .new(@driv er)
  48       @detai l = Reques tAppointme ntDetail.n ew(@driver )
  49       @error  = Error_V alidation. new(@drive r)
  50       @feedb ack=Feedba ck.new(@dr iver)
  51       TITLE  = "Appoint ments/Requ ests"
  52  
  53       #mongo
  54       @db =  connectToM ongoDB("va r-utility" )
  55       restor eCollectio n("siteSup portingVAR ", "var-ut ility", "s ites-suppo rting-var- exported2. json", @db )
  56       restor eCollectio n("clinica l-services ", "var-ut ility", "c linical_se rvices_def ault.json" , @db)
  57       restor eCollectio n("custom- friendly-t ext", "var -utility",  "facility _friendly_ name.json" , @db)
  58       restor eCollectio n("request Eligibilit yCriteria" , "var-uti lity", "re questEligi bilityCrit eria.json" , @db)
  59       restor eCollectio n("directB ookingElig ibilityCri teria", "v ar-utility ", "direct Scheduling Enabled.js on", @db)
  60  
  61       @today  = getDate NthDaysFro mNow(0, "% m/%d/%Y")
  62  
  63       @fiveD aysLater =  getDateNt hDaysFromN ow(5, "%m/ %d/%Y")
  64       @ninty DaysLater  = getDateN thDaysFrom Now(90, "% m/%d/%Y")
  65  
  66       #this  will not w ork in CI  but the da ta will be  reset in  the jenkin s
  67       @patie ntID = "10 06088937V0 99668"
  68       @patie ntID2 = "1 113138327"
  69       @patie ntID3 = "1 006088937"
  70       delete PatientDat a(@patient ID)
  71       delete PatientDat a(@patient ID2)
  72       delete PatientDat a(@patient ID3)
  73       @@loca tionID="52 3A5"
  74       @@loca tionName=" BROCKTON V AMC"
  75       @@frie ndlyName = "Facility  Friendly T ext"
  76       @@new_ message_50  = "012345 6789012345 6789012345 6789012345 6789012345 6789"
  77         @common.lo ginEndsOnH ome( pw_reda c t e d )
  78     end
  79  
  80     after(:a ll) do
  81       @drive r.close
  82     end
  83  
  84     context  'AC#VAR-23 42|TC#VAR- 2513: New  Appointmen t - Enter  Request De tails Crit eria
  85               AC#VAR-27 60|TC#VAR- 2767: Emai l preferen ce
  86               AC#VAR-24 80|TC#VAR- 2517: New  Request -  Submission  Confirmat ion Criter ia
  87               AC#VAR-40 62|TC#VAR- 4063: Revi se Best Ti mes to Cal l options
  88               AC#VAR-44 77|TC#VAR- 4478: Requ est Detail s - Revise  to group  fields rel ated to co mmunicatin g with a c lerk
  89               AC#VAR-10 196|TC#101 97: Submit  Request -  Save to r equest db'  do
  90       it "Ve rify Reque st Details  section i s displaye d" do
  91         #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
  92         #@co mmon.login EndsOnHome ("zztest.p atient01",  "pass", " D123401")
  93         @com mon.select AddAppoint mentButton ("VA")
  94         @new _request.s electNewAp pointmentA ndSchedule (PRIMARY_C ARE, "523" , "523A5",  "clerk")
  95         expe ct(@new_re quest.requ est_detail s_legend). to eq("Req uest Detai ls")
  96       end
  97  
  98  
  99       it "Mu ltiple Fac ility: Ver ify label,  informati onal text  and multip le locatio ns" do
  100         expe cted_conte nt =[\
  101                      "*  required  field",
  102                      "S tep 1: Typ e of Care" ,
  103                      "T he VA Appo intments a pp support s scheduli ng specifi c types of  care. If  you do not  find the  care you n eed, pleas e contact  your facil ity for as sistance." ,
  104                      "*  Select th e type of  care you n eed:",
  105                      "S elect",
  106                      "P rimary Car e",
  107                      "A udiology",
  108                      "E xpress Car e",
  109                      "O ptometry",
  110                      "O utpatient  Mental Hea lth",
  111                      "S tep 2: Cit y, State",
  112                      "*  Choose th e closest  city and s tate for t his appoin tment:",
  113                      "S elect",
  114                      "D es Moines,  IA",
  115                      "I owa City,  IA",
  116                      "B OSTON, MA" ,
  117                      "O maha, NE",
  118                      "S tep 3: Loc ation",
  119                      "T he followi ng facilit y location s support  scheduling  Primary C are appoin tments thr ough this  app. If yo u cannot f ind the lo cation you  need, ple ase visit  the VA Fac ility Loca tor to con tact the f acility fo r assistan ce.",
  120                      "*  Select th e location  you want  to visit:" ,
  121                      "S elect",
  122                      "B OSTON HCS  VAMC (BOST ON, MA) -  Your Prima ry Care Te am",
  123                      "B ROCKTON VA MC (BROCKT ON, MA)",
  124                      "Q UINCY (QUI NCY, MA)",
  125                      "P roviders:" ,
  126                      "C reamer, Ke nt",
  127                      "Y our Care T eam (PACT) ",
  128                      "Y our Care T eam (PACT)  for BROCK TON VAMC",
  129                      "S tep 4: Sch eduling Me thod",
  130                      "T he locatio n you sele cted suppo rts the fo llowing sc heduling m ethods:",
  131                      "*  Select a  scheduling  method:",
  132                      "S chedule My self",
  133                      "T his method  is not av ailable fo r the type  of care y ou selecte d.",
  134                      "S ubmit a Re quest to V A Schedule r",
  135                      "R equest Det ails",
  136                      "*  Purpose o f Visit:",
  137                      "S elect",
  138                      "R outine/Fol low-Up",
  139                      "N ew Issue",
  140                      "M edication  Concern",
  141                      "O ther",
  142                      "*  Preferred  Type of V isit:",
  143                      "O ffice Visi t",
  144                      "P hone Call" ,
  145                      "V ideo Confe rence",
  146                      "P referred A ppointment  Dates/Tim es",
  147                       " You may re quest an a ppointment  date betw een " + @f iveDaysLat er + " and  " + @nint yDaysLater  + ".",
  148                       " * Choice # 1 Date:",
  149                       " Choice #1  Time:",
  150                       " AM", "PM",
  151                       " Choice #2  Date:",
  152                       " Choice #2  Time:",
  153                       " AM", "PM",
  154                       " Choice #3  Date:",
  155                       " Choice #3  Time:",
  156                       " AM", "PM",
  157                       " Communicat ing with a  Schedulin g Clerk Ab out this R equest",
  158                       " Please pro vide your  phone info rmation in  case we n eed to con tact you." ,
  159                       " If you wou ld like to  talk with  VA, you m ay ask a c lerk to ca ll you, or  you may m essage a c lerk throu gh this ap p.",
  160                       " * Phone:",
  161                       " * Verify P hone:",
  162                       " * Best Tim es for VA  to Call:",
  163                       " Morning",
  164                       " Afternoon" ,
  165                       " Evening",
  166                       " Would you  like the V A to call  you regard ing this r equest?",
  167                       " Yes",
  168                       " No",
  169                       " Message a  Scheduling  Clerk",
  170                       " (100 char  limit)",
  171                       " 100 charac ters remai ning",
  172                       " Email Pref erences",
  173                       " Send me up dates on m y appointm ents and r equests:",
  174                       " Informatio n about up dates on m y appointm ents and r equests",
  175                       " Yes",
  176                       " No",
  177                       " Submit Req uest Cance l"
  178         ]
  179         actu al_content  = @new_re quest.getS creenConte nt.split(" \n")
  180         expe cted_conte nt.each_wi th_index d o | expect edScreenRo w, i |
  181           ex pect(actua l_content[ i].strip). to eq(expe ctedScreen Row.strip)
  182         end
  183  
  184       end
  185  
  186       it "Sh ould verif y Purpose  of Visit i s required " do
  187         @new _request.c lickSubmit Request
  188         veri fyErrorMes sage("Purp ose of Vis it field i s required .")
  189       end
  190  
  191       it "Sh ould Verif y purpose  of visit o ptions" do
  192         expe ct(@new_re quest.purp ose_of_vis it_options ).to eq([" Select", " Routine/Fo llow-Up",  "New Issue ", "Medica tion Conce rn", "Othe r"])
  193  
  194       end
  195  
  196       it "Sh ould verif y office v isit prefe rred type  of visit b y default  when no pu rpose of v isit is se lected" do
  197         expe ct(@new_re quest.type _of_visit_ radio_elem ents[0].se lected?).t o eq(true)
  198       end
  199  
  200       it "sh ould verif y preferre d type of  visit is p hone call  for Medica tion conce rn and tex t" do
  201  
  202         @new _request.p urpose_of_ visit = "M edication  Concern"
  203         expe ct(@new_re quest.type _of_visit_ radio_elem ents[1].se lected?).t o eq(true)
  204         expe ct(@new_re quest.phon e_call_war ning).to e q("A Phone  Call visi t is recom mended for  Medicatio n Concerns .")
  205       end
  206  
  207  
  208       it "Sh ould verif y other pu rpose of v isit secti on max cha racter" do
  209         @new _request.p urpose_of_ visit = "O ther"
  210         @new _request.o ther_purpo se_text_el ement.when _present(T IME_OUT_LI MIT)
  211         @new _request.o ther_purpo se_text =  "MaxChars5 0MaxChars5 0MaxChars5 0MaxChars5 0MaxChars5 0"
  212         expe ct(@new_re quest.othe r_purpose_ text.lengt h).to eq(5 0)
  213       end
  214  
  215       it "Sh ould verif y other pu rpose of v isit secti on max cha racter doe s not take  more than  50 charac ters" do
  216         @new _request.o ther_purpo se_text =  "MaxChars5 0MaxChars5 0MaxChars5 0MaxChars5 0MaxChars5 0" + "abcd efghi"
  217         @new _request.o ther_purpo se_text_el ement.fire _event('on blur')
  218  
  219         expe ct(@new_re quest.othe r_purpose_ text).to e q("MaxChar s50MaxChar s50MaxChar s50MaxChar s50MaxChar s50")
  220         expe ct(@new_re quest.othe r_purpose_ text.lengt h).to eq(5 0)
  221  
  222       end
  223  
  224  
  225       it "sh ould verif y availabl e options  for Type o f Visit" d o
  226         expe ct(@new_re quest.type _of_visit_ radio_valu es).to eq( ["Office V isit", "Ph one Call",  "Video Co nference"] )
  227  
  228       end
  229  
  230  
  231       it "Sh ould verif y instruct ional text  when Vide o Conferen ce is sele cted" do
  232         @new _request.s elect_type _of_visit_ radio("Vid eo Confere nce")
  233         expe ct(@new_re quest.type _of_visit_ radio_elem ents[2].se lected?).t o eq(true)
  234         expe ct(@new_re quest.vide o_conferen ce_warning ).to eq("V ideo Confe rences are  not avail able in al l VA clini cs. If Vid eo Confere nce appoin tments are  not avail able, your  request w ill be tre ated as a  Phone Call  request." )
  235       end
  236  
  237       it "Sh ould verif y 1st Choi ce Appoint ment, am/p m is requi red" do
  238         @new _request.c lickSubmit Request
  239         veri fyErrorMes sage("Choi ce #1 Date  field is  required." )
  240       end
  241  
  242       it "Ve rify Choic e 1 AM rad io is enab led by def ault" do
  243         expe ct(@new_re quest.am_p m1_element s[0].enabl ed?).to eq (true)
  244         expe ct(@new_re quest.am_p m1_selecte d?).to eq( "AM")
  245       end
  246  
  247       it "Sh ould verif y option d ate 1 rang e error me ssage" do
  248         @new _request.o ption_date 1 = ""
  249  
  250         #cal endar func tionality  automated  in calenda r_picker_s epc.rb
  251         #Val ue must be  between t oday+5 and  today+90;
  252         thre eDaysLater  = getDate NthDaysFro mNow(3, "% m/%d/%Y")
  253         @new _request.o ption_date 1 = threeD aysLater
  254         @new _request.o ption_date 1_element. fire_event ('onblur')
  255         expe ct(@new_re quest.opti on_date1_e rror).to e q("Please  enter a da te between  " + @five DaysLater  + " and "  + @nintyDa ysLater +  ".")
  256       end
  257  
  258       it "Sh ould verif y option d ate 1 rang e error on  submit" d o
  259         @new _request.c lickSubmit Request
  260         veri fyErrorMes sage("Plea se enter a  date betw een " + @f iveDaysLat er + " and  " + @nint yDaysLater  + ".")
  261       end
  262  
  263       it "Ve rify date  range cann ot be more  than 90 d ays" do
  264  
  265         hund redDaysLat er = getDa teNthDaysF romNow(100 , "%m/%d/% Y")
  266         @new _request.o ption_date 1 = hundre dDaysLater
  267         expe ct(@new_re quest.opti on_date1_e rror).to e q("Please  enter a da te between  " + @five DaysLater  + " and "  + @nintyDa ysLater +  ".")
  268       end
  269  
  270       it "Ve rify Valid  date can  be selecte d" do
  271         @new _request.o ption_date 1 = getDat eNthDaysFr omNow(9, " %m/%d/%Y")
  272         expe ct(@new_re quest.opti on_date1_e rror).to e q("")
  273       end
  274  
  275       it "Ve rify PM ra dio can be  selected"  do
  276         @new _request.s elect_am_p m1("PM")
  277         expe ct(@new_re quest.am_p m1_selecte d?).to eq( "PM")
  278  
  279       end
  280  
  281       it "Sh ould verif y 2st Choi ce Appoint ment, am/p m is not e nabled as  default" d o
  282         expe ct(@new_re quest.am_p m2_element s[0].enabl ed?).to eq (false)
  283  
  284       end
  285  
  286       it "Sh ould Verif y @nd choi se cannot  be before  5 days fro m now" do
  287         #cal endar func tionality  automated  in calenda r_picker_s epc.rb
  288         #Val ue must be  between t oday+5 and  today+90;
  289         twoD aysLater =  getDateNt hDaysFromN ow(2, "%m/ %d/%Y")
  290         @new _request.o ption_date 2 = twoDay sLater
  291         @new _request.o ption_date 2_element. fire_event ('onblur')
  292         @new _request.o ption_date 2_error_el ement.when _present(T IME_OUT_LI MIT)
  293         expe ct(@new_re quest.opti on_date2_e rror).to e q("Please  enter a da te between  " + @five DaysLater  + " and "  + @nintyDa ysLater +  ".")
  294  
  295       end
  296  
  297       it "Sh ould Verif y AM/PM ra dio of sec ond Choice  is not se lected by  default" d o
  298         expe ct(@new_re quest.am_p m2_selecte d?).to eq( false)
  299  
  300       end
  301  
  302       it "Sh ould Verif y error me ssage on s ubmitting  a wrong se cond choic e date" do
  303         @new _request.c lickSubmit Request
  304         veri fyErrorMes sage("Plea se enter a  date betw een " + @f iveDaysLat er + " and  " + @nint yDaysLater  + ".")
  305  
  306       end
  307  
  308       it "Sh ould Verif y error me ssage on s ubmitting  a second c hoice date  over 90 d ays" do
  309         hund redtwentyD aysLater =  getDateNt hDaysFromN ow(120, "% m/%d/%Y")
  310         @new _request.o ption_date 2 = hundre dtwentyDay sLater
  311         expe ct(@new_re quest.opti on_date2_e rror).to e q("Please  enter a da te between  " + @five DaysLater  + " and "  + @nintyDa ysLater +  ".")
  312  
  313       end
  314  
  315       it "Sh ould Verif y valid se cond choic e date can  be select ed" do
  316  
  317         tenD aysLater =  getDateNt hDaysFromN ow(10, "%m /%d/%Y")
  318         @new _request.o ption_date 2 = tenDay sLater
  319         expe ct(@new_re quest.opti on_date2_e rror).to e q("")
  320       end
  321  
  322       it "Sh ould Verif y 2nd choi ce AM/PM r adio is en abled on v alid date"  do
  323  
  324         expe ct(@new_re quest.am_p m2_element s[0].enabl ed?).to eq (true)
  325       end
  326  
  327       it "Sh ould Verif y default  radio selc tion is AM  for secon d cohice"  do
  328         slee p 1
  329         expe ct(@new_re quest.am_p m2_selecte d?).to eq( "AM")
  330       end
  331  
  332       it "Sh ould Selec t PM as se cond choic e" do
  333         @new _request.s elect_am_p m2("PM")
  334         expe ct(@new_re quest.am_p m2_selecte d?).to eq( "PM")
  335       end
  336  
  337       it "Sh ould verif y 3st Choi ce Appoint ment, am/p m is disab led by def ault" do
  338         expe ct(@new_re quest.am_p m3_element s[0].enabl ed?).to eq (false)
  339       end
  340  
  341       it "sh ould verif y default  range for  third choi ce" do
  342         #cal endar func tionality  automated  in calenda r_picker_s epc.rb
  343         #Val ue must be  between t oday+5 and  today+90;
  344         twoD aysLater =  getDateNt hDaysFromN ow(2, "%m/ %d/%Y")
  345         @new _request.o ption_date 3 = twoDay sLater
  346         expe ct(@new_re quest.opti on_date3_e rror).to e q("Please  enter a da te between  " + @five DaysLater  + " and "  + @nintyDa ysLater +  ".")
  347       end
  348  
  349       it "sh ould verif y 3rd choi ce AM/Pm r aido is no t selected " do
  350         expe ct(@new_re quest.am_p m3_selecte d?).to eq( false)
  351       end
  352  
  353       it "Sh ould verif y date ran ge error f or wrong 3 rd choice  date" do
  354         @new _request.c lickSubmit Request
  355         veri fyErrorMes sage("Plea se enter a  date betw een " + @f iveDaysLat er + " and  " + @nint yDaysLater  + ".")
  356       end
  357  
  358       it "Sh ould Verif y 3rd choi ce cannot  be more th an 90 days  from now"  do
  359  
  360         hund redtwentyD aysLater =  getDateNt hDaysFromN ow(120, "% m/%d/%Y")
  361         @new _request.o ption_date 3 = hundre dtwentyDay sLater
  362         expe ct(@new_re quest.opti on_date3_e rror).to e q("Please  enter a da te between  " + @five DaysLater  + " and "  + @nintyDa ysLater +  ".")
  363       end
  364  
  365       it "Sh ould Verif y valid da te can be  selected f or 3rd cho ice" do
  366         eigh tDaysLater  = getDate NthDaysFro mNow(8, "% m/%d/%Y")
  367         @new _request.o ption_date 3 = eightD aysLater
  368         expe ct(@new_re quest.opti on_date3_e rror).to e q("")
  369       end
  370  
  371       it "Sh ould Verif y PM can b e selected  as 3rd Ch oice" do
  372         @new _request.s elect_am_p m3("PM")
  373         expe ct(@new_re quest.am_p m3_selecte d?).to eq( "PM")
  374       end
  375  
  376  
  377       it "Re quest a ph one call &  best time  to call i s visible"  do
  378  
  379         expe ct(@new_re quest.phon eNumber_el ement.visi ble?).to e q(true)
  380         expe ct(@new_re quest.veri fyPhoneNum ber_elemen t.visible? ).to eq(tr ue)
  381         expe ct(@new_re quest.best TimeToCall _morning_e lement.vis ible?).to  eq(true)
  382       end
  383  
  384       it "sh ould verif y phone nu mber is re quired" do
  385         @new _request.c lickSubmit Request
  386         veri fyErrorMes sage("Phon e field is  required. ")
  387         veri fyErrorMes sage("Veri fy Phone f ield is re quired.")
  388  
  389       end
  390  
  391       it "sh ould Verif y phone nu mber is up dated to d efault for mat" do
  392         @new _request.p honeNumber  = "703222 3333"
  393         @new _request.p honeNumber _element.f ire_event( 'onblur')
  394         expe ct(@new_re quest.phon eNumber).t o eq("(703 ) 222-3333 ")
  395       end
  396  
  397       it "sh ould verif y phone nu mber is up dated for  alphabets"  do
  398         @new _request.p honeNumber  = "111Abc 1111111"
  399         @new _request.p honeNumber _element.f ire_event( 'onblur')
  400         expe ct(@new_re quest.phon eNumber).t o eq("(111 ) 111-1111 ")
  401       end
  402  
  403       it "sh ould verif y a valid  phone numb er check"  do
  404         @new _request.c lickSubmit Request
  405         veri fyErrorMes sage("Plea se enter a  valid US  Phone numb er.")
  406       end
  407  
  408       it "sh ould Verif y phone nu mbers veri fication"  do
  409         @new _request.p honeNumber  = "703222 3333"
  410         @new _request.p honeNumber _element.f ire_event( 'onblur')
  411         @new _request.v erifyPhone Number = " 1112223333 "
  412         @new _request.v erifyPhone Number_ele ment.fire_ event('onb lur')
  413         @new _request.c lickSubmit Request
  414         veri fyErrorMes sage("The  phone numb ers do not  match.")
  415  
  416       end
  417  
  418       it "Ve rify no er ror on mat ching phon e numbers"  do
  419         @new _request.v erifyPhone Number = " 7032223333 "
  420         @new _request.v erifyPhone Number_ele ment.fire_ event('onb lur')
  421         expe ct(@new_re quest.veri fy_phone_n umber_erro r).to eq(" ")
  422       end
  423  
  424       it "Sh ould Verif y Best Tim es for VA  to Call fi eld is req uired" do
  425  
  426         @new _request.c lickSubmit Request
  427         veri fyErrorMes sage("Best  Times for  VA to Cal l field is  required. ")
  428  
  429       end
  430  
  431       it "sh ould verif y best tim e to call  options ca n be check ed and unc hecked" do
  432  
  433         @new _request.c heck_bestT imeToCall_ morning
  434         @new _request.c heck_bestT imeToCall_ afternoon
  435         @new _request.c heck_bestT imeToCall_ evening
  436         @new _request.u ncheck_bes tTimeToCal l_afternoo n
  437         @new _request.u ncheck_bes tTimeToCal l_evening
  438         expe ct(@new_re quest.best TimeToCall _morning_c hecked?).t o eq(true)
  439         expe ct(@new_re quest.best TimeToCall _afternoon _checked?) .to eq(fal se)
  440         expe ct(@new_re quest.best TimeToCall _evening_c hecked?).t o eq(false )
  441       end
  442  
  443       it "sh ould verif y Message  a Scheduli ng Clerk s ection" do
  444         expe ct(@new_re quest.mess age_header ).to eq("M essage a S cheduling  Clerk")
  445         expe ct(@new_re quest.new_ message_el ement.attr ibute("pla ceholder") ).to eq("M essages (1 00 charact ers max) s hould not  be used fo r cancelli ng an appo intment or  for clini cal questi ons that m ay need pr ovider att ention.")
  446         expe ct(@new_re quest.mess age_counte r).to eq(" 100 charac ters remai ning")
  447  
  448       end
  449  
  450  
  451       it "sh ould verif y characte r remainin g for mess age a sche duling cle rk" do
  452         @new _request.n ew_message  = @@new_m essage_50
  453         expe ct(@new_re quest.mess age_counte r).to eq(" 50 charact ers remain ing")
  454  
  455       end
  456  
  457  
  458       it "sh ould verif y max char acter rema ining 0 fo r message  a scheduli ng clerk"  do
  459         @new _request.n ew_message  = @@new_m essage_50  + @@new_me ssage_50
  460         expe ct(@new_re quest.new_ message).t o eq(@@new _message_5 0 + @@new_ message_50 )
  461         expe ct(@new_re quest.mess age_counte r).to eq(" 0 characte rs remaini ng")
  462  
  463       end
  464  
  465       it "sh ould verif y no more  than 100 c hracters a llowed for  Message a  clerk" do
  466         @new _request.n ew_message  = @@new_m essage_50  + @@new_me ssage_50 +  "!!@#!@#! @#%^^"
  467         expe ct(@new_re quest.new_ message).t o eq(@@new _message_5 0 + @@new_ message_50 )
  468         expe ct(@new_re quest.mess age_counte r).to eq(" 0 characte rs remaini ng")
  469       end
  470  
  471       it "sh ould verif y default  selection  for VA to  call reagr ding this  request" d o
  472         expe ct(@new_re quest.requ estedPhone Call_selec ted?).to e q("false")
  473  
  474       end
  475  
  476       it "sh ould verif y request  a phone ca ll can be  slected to  Yes" do
  477         @new _request.r equestedPh oneCall_ye s_element. click
  478         expe ct(@new_re quest.requ estedPhone Call_selec ted?).to e q("true")
  479  
  480       end
  481  
  482  
  483       it "sh ould verif y request  a phone ca ll No can  be selecte d" do
  484         @new _request.r equestedPh oneCall_no _element.c lick
  485         expe ct(@new_re quest.requ estedPhone Call_selec ted?).to e q("false")
  486  
  487       end
  488  
  489       it "sh ould verif y change s election f or request  a phone c all" do
  490         @new _request.r equestedPh oneCall_ye s_element. click
  491         expe ct(@new_re quest.requ estedPhone Call_selec ted?).to e q("true")
  492  
  493       end
  494  
  495       it "sh ould verif y Validate  Email Pre ference de fault sele ction" do
  496         expe ct(@new_re quest.emai lPref_elem ents[0].se lected?).t o eq(false )
  497         expe ct(@new_re quest.emai lPref_elem ents[1].se lected?).t o eq(true)
  498       end
  499  
  500  
  501       it "sh ould verif y email pr ef can be  selected t o yes" do
  502         @new _request.s elect_emai lPref("tru e")
  503         @new _request.e mail_eleme nt.when_pr esent(TIME _OUT_LIMIT )
  504         expe ct(@new_re quest.emai lPref_elem ents[0].se lected?).t o eq(true)
  505         expe ct(@new_re quest.emai lPref_elem ents[1].se lected?).t o eq(false )
  506         expe ct(@new_re quest.emai l_element. present?). to eq(true )
  507  
  508       end
  509  
  510       it "sh ould verif y email fi eld is req uired" do
  511  
  512         @new _request.s chedule_ap pointment_ element.wa it_until_p resent(TIM E_OUT_LIMI T)
  513         butt on_element  = @driver .button(:i d => 'sche dule-appoi ntment-btn ')
  514         @dri ver.execut e_script(" $(argument s[0]).clic k();",butt on_element )
  515        # @ne w_request. clickSubmi tRequest
  516         slee p 2
  517         veri fyErrorMes sage("Emai l field is  required. ")
  518  
  519       end
  520  
  521       it "ve rify valid  email is  entered" d o
  522  
  523         @new _request.e mail = "zz test.patie nt01@test. com"
  524         @new _request.e mail_eleme nt.fire_ev ent('onblu r')
  525         expe ct(@new_re quest.emai l).to eq(" zztest.pat ient01@tes t.com")
  526  
  527       end
  528  
  529       xit "s hould veri fy unique  date selec tion for a ll choice  dates" do
  530         puts  "TODO: th ere is an  open bug f or this. E nable once  bug is fi xed. Pleas e do not d elete"
  531         sixD aysLater =  getDateNt hDaysFromN ow(6, "%m/ %d/%Y")
  532         @new _request.o ption_date 1 = sixDay sLater
  533         @new _request.s elect_am_p m1("PM")
  534         @new _request.o ption_date 2 = sixDay sLater
  535         @new _request.s elect_am_p m2("PM")
  536         @new _request.o ption_date 3 = sixDay sLater
  537         @new _request.s elect_am_p m3("PM")
  538         @new _request.s elect_requ estedPhone Call("true ")
  539         @new _request.c lickSubmit Request
  540         veri fyErrorMes sage("Choi ce #1 Date : Date pre ference mu st be uniq ue.")
  541         veri fyErrorMes sage("Choi ce #2 Date : Date pre ference mu st be uniq ue.")
  542         veri fyErrorMes sage("Choi ce #3 Date : Date pre ference mu st be uniq ue.")
  543       end
  544  
  545  
  546       it "sh ould verif y form val idation wh en request  for phone  call is y es" do
  547         @new _request.s elect_requ estedPhone Call("fals e")
  548         sixD aysLater =  getDateNt hDaysFromN ow(6, "%m/ %d/%Y")
  549         @new _request.o ption_date 1 = sixDay sLater
  550         @new _request.s elect_am_p m1("PM")
  551         @new _request.o ption_date 2 = sixDay sLater
  552         @new _request.s elect_am_p m2("PM")
  553         @new _request.o ption_date 3 = sixDay sLater
  554         @new _request.s elect_am_p m3("PM")
  555         @new _request.c lickSubmit Request
  556         veri fyErrorMes sage("Choi ce #1 Date : Date pre ference mu st be uniq ue.")
  557         veri fyErrorMes sage("Choi ce #2 Date : Date pre ference mu st be uniq ue.")
  558         veri fyErrorMes sage("Choi ce #3 Date : Date pre ference mu st be uniq ue.")
  559       end
  560  
  561  
  562       it "sh ould chang e option d ates to un ique" do
  563         tenD aysLater =  getDateNt hDaysFromN ow(10, "%m /%d/%Y")
  564         @new _request.o ption_date 2 = tenDay sLater
  565         @new _request.o ption_date 2_element. fire_event ('onblur')
  566         elev enDaysLate r = getDat eNthDaysFr omNow(11,  "%m/%d/%Y" )
  567         @new _request.o ption_date 3 = eleven DaysLater
  568         @new _request.o ption_date 3_element. fire_event ('onblur')
  569         expe ct(@new_re quest.opti on_date2_e rror).to e q("")
  570         expe ct(@new_re quest.opti on_date3_e rror).to e q("")
  571  
  572       end
  573  
  574       it "sh ould verif y request  is submitt ed" do
  575         @new _request.c lickSubmit Request
  576         @com mon.waitWh ileSpinner Present
  577         @det ail.status _element.w hen_presen t(TIME_OUT _LIMIT)
  578         expe ct(@detail .has_expec ted_title? ).to eq(tr ue)
  579       end
  580     end
  581  
  582     context  "AC# VAR-2 480|TC # V AR-2517:   New Reques t -Submiss ion confir mation cri teria" do
  583       it "Sh ould verif y request  Title: Sta tus, instr uctional t ext and da te" do
  584         @det ail.status _element.w hen_presen t(TIME_OUT _LIMIT)
  585         expe ct(@detail .has_expec ted_title? ).to eq(tr ue)
  586  
  587         expe ct(@detail .status_el ement.text ).to eq("S tatus: Sub mitted")
  588         expe ct(@detail .status_la st_updated _element.t ext).to in clude("Upd ated: " +   @today)
  589  
  590         expe ct(@detail .status_de sc_element .text).to  eq("View s tatus upda tes for th is request  under the  \"Request s\" sectio n of the A ppointment s and Requ ests page.  Once sche duled, the  resulting  appointme nt will be  displayed  under the  â€œAppoin tments”  section of  the same  page.")
  591  
  592       end
  593  
  594       it "Sh ould verif y Provide  Feedback l ink is dis played on  Submission  Confirmat ion page"  do
  595         expe ct(@detail .provide_f eedback_li nk_element .text).to  eq("Provid e feedback  on this s ubmission. ")
  596       end
  597  
  598       it "Sh ould verif y submitte d request  details" d o
  599         EXPE CTED_TEXT  = [\
  600           "R equest Det ails",
  601           "S ubmitted:  " + @today  + " @HH:M M"   " Fac ility: #{@ @locationN ame} Type  of Care: "  + PRIMARY _CARE  + "  Preferred  Type of V isit: " +  "Video Con ference",
  602           "P urpose of  Visit: Oth er Other P urpose of  Visit: Max Chars50Max Chars50Max Chars50Max Chars50Max Chars50",
  603           "P referred A ppointment  Date/Time ",
  604           "1 st Choice:  " + getDa teNthDaysF romNow(6,  "%m/%d/%Y" ) + " " +  "AM" + " 2 nd Choice:  " + getDa teNthDaysF romNow(10,  "%m/%d/%Y ") + " " +  "AM" + "  3rd Choice : " + getD ateNthDays FromNow(11 , "%m/%d/% Y") + " "  + "AM",
  605           "Y our Contac t Informat ion",
  606           "E mail zztes t.patient0 1@test.com  Phone (70 3) 222-333 3 Best Tim es for VA  to Call Mo rning"
  607         ]
  608         actu al_text =  @detail.re quest_deta ils_group_ element.te xt.split(" \n")
  609         EXPE CTED_TEXT. each_with_ index do |  expectedS creenRow,  i |
  610           if  (expected ScreenRow. include?(" Submitted: "))
  611              expect(act ual_text[i ]).to incl ude("Submi tted: " +  @today)
  612              expect(act ual_text[i ]).to incl ude("Locat ion: #{@@l ocationNam e}")
  613           el se
  614              expect(act ual_text[i ]).to eq(e xpectedScr eenRow)
  615           en d
  616         end
  617       end
  618  
  619       it "sh ould verif y messagin g a schedu ling clerk  section"  do
  620         EXPE CTED_TEXT  = [\
  621              "Message a  Schedulin g Clerk",
  622              "You may s end up to  two (2) me ssages whi le this re quest is i n Submitte d status.  If you nee d addition al informa tion, plea se call yo ur local V A Medical  Center"
  623         ]
  624         actu al_text =  @detail.co mmunicate_ with_clerk _group_ele ment.text. split("\n" )
  625         EXPE CTED_TEXT. each_with_ index do |  expectedS creenRow,  i |
  626           ex pect(actua l_text[i]) .to eq(exp ectedScree nRow)
  627         end
  628       end
  629  
  630       it "sh ould verif y Email is  saved in  oracle" do
  631          sle ep 2
  632          ema ilId = exe cuteAndGet DataAndNum Row("SELEC T EMAIL_AD DRESS FROM  VARDB.NOT IFICATION_ PREFERENCE  WHERE PAT IENT_ID =  '111313832 7'")
  633          ema ilArr = em ailId.spli t("||")
  634          exp ect(emailA rr[0]).to  eq("zztest .patient01 @test.com" )
  635       end
  636  
  637       it "Sh ould verif y location  ID is sto red in ora cle" do
  638         faci lityData =  executeAn dGetDataAn dNumRow("S ELECT FACI LITY_CODE  FROM VARDB .APPOINTME NT_REQUEST  WHERE PAT IENT_ID =  '111313832 7' and STA TUS ='Subm itted'")
  639         faci lityArr =  facilityDa ta.split(" ||")
  640         faci lityArr =  facilityAr r[0].split (",")
  641         puts  "Data is:  ", facili tyArr[0]
  642         expe ct(facilit yArr[0]).t o eq(@@loc ationID)
  643       end
  644  
  645       it "sh ould verif y details  on Back bu tton" do
  646         expe ct(@detail .back_btn_ element.ex ists?).to  eq(true)
  647  
  648         #lar ge form fa ctors
  649         expe ct(@detail .back_labe l).to eq(" Appointmen ts/Request s")
  650         expe ct(@detail .back_btn_ element.vi sible?).to  eq(true)
  651         expe ct(@detail .back_btn_ element.at tribute("a ria-label" )).to eq(" Return to  Appointmen ts and Req uests")
  652  
  653         #@de tail.back_ btn
  654  
  655       end
  656  
  657       it "Sh ould click  on Provid e Feedback  link whic h will tak e to Feedb ack form p age and ve rify Feedb ack form c ontent" do
  658         @det ail.provid e_feedback _link
  659         @fee dback.feed backTitle_ element.wh en_visible (TIME_OUT_ LIMIT)
  660         expe ct(@feedba ck.feedbac kTitle_ele ment.text) .to eq("Fe edback")
  661         EXPE CTED_TEXT  = [\
  662              "Please ta ke a momen t to give  us your fe edback. Yo ur respons es will be  anonymous  and help  us to impr ove our se rvice to y ou.",
  663              "How likel y are you  to recomme nd this ap plication  to someone  else?",
  664              "How likel y are you  to recomme nd this ap plication  to someone  else? 1 ( not at all  likely) a nd 10 (ext remely lik ely)",
  665              "0 1 2 3 4  5 6 7 8 9  10",
  666              "Not At Al l Likely",
  667              "Extremely  Likely",
  668              "Comments"
  669         ]
  670         actu al_text= @ feedback.f eedback_fo rm_element .text.spli t("\n")
  671         EXPE CTED_TEXT. each_with_ index do |  expectedS creenRow,  i |
  672           ex pect(actua l_text[i]) .to eq(exp ectedScree nRow)
  673         end
  674       end
  675  
  676       it "sh ould verif y Feedback  page on a  smaller f orm factor " do
  677         resi zeWindowTo (400,800)
  678         EXPE CTED_TEXT  = [\
  679              "Please ta ke a momen t to give  us your fe edback. Yo ur respons es will be  anonymous  and help  us to impr ove our se rvice to y ou.",
  680              "How likel y are you  to recomme nd this ap plication  to someone  else?",
  681              "How likel y are you  to recomme nd this ap plication  to someone  else? 1 ( not at all  likely) a nd 10 (ext remely lik ely)",
  682              "Select",
  683              "0 - Not a t all like ly","1","2 ", "3" ,"4 ", "5", "6 ", "7", "8 ", "9", "1 0 - Extrem ely likely ",
  684              "Comments"
  685         ]
  686         actu al_text= @ feedback.f eedback_fo rm_element .text.spli t("\n")
  687         EXPE CTED_TEXT. each_with_ index do |  expectedS creenRow,  i |
  688           ex pect(actua l_text[i]) .to eq(exp ectedScree nRow)
  689         end
  690       end
  691  
  692       it "Se lect value  should di sable Subm it button"  do
  693         @fee dback.sele ctFeedback onSmallerf orm("Selec t")
  694         expe ct(@feedba ck.feedbac k_submit_e lement.ena bled?).to  eq false
  695       end
  696  
  697       it "us er's selec tion shoul d enable S ubmit butt on" do
  698         @fee dback.sele ctFeedback onSmallerf orm("3")
  699         expe ct(@feedba ck.feedbac k_submit_e lement.ena bled?).to  eq true
  700       end
  701  
  702       it "us er's selec tion shoul d be retai ned in def ault windo w view" do
  703         resi zeWindowTo Default
  704         expe ct(@feedba ck.feedbac k_btn_elem ents[2].at tribute("f or")).to e q("two")
  705       end
  706  
  707       it "Us er should  able to pr ovide feed back and s ubmit succ essfully"  do
  708         @fee dback.sele ctFeedback ondefullfo rm("4")
  709         @fee dback.feed back_comme nt="This i s a Test"
  710         @fee dback.feed back_submi t
  711         @com mon.waitWh ileSpinner Present
  712         expe ct(@feedba ck.thanks_ msg_elemen t.text).to  eq("Thank  you! Your  feedback  has been s ubmitted." )
  713       end
  714  
  715       it "sh ould verif y clicking  on back b utton retu rns to lan ding page"  do
  716         butt on_element  = @driver .button(:i d => 'back -btn')
  717         @dri ver.execut e_script(" $(argument s[0]).clic k();",butt on_element )
  718         @com mon.waitWh ileSpinner Present
  719         @lan ding_appoi ntments.pr imary_head er_element .when_pres ent(TIME_O UT_LIMIT)
  720         wait TillReques tsDisplay
  721         expe ct(@landin g_appointm ents.getNt hRequestTa bleHeader( 1)).to eq( "Last Upda ted")
  722       end
  723  
  724       it "sh ould verif y Request  list: Subm itted Requ est added  Verify Lab els and de tails" do
  725  
  726         #Col umn 1 Labe l: Last Up dated
  727         expe ct(@landin g_appointm ents.getNt hRequestTa bleHeader( 1)).to eq( "Last Upda ted")
  728         expe ct(@landin g_appointm ents.getRe questTextF orRowCol(1 ,1)).to eq (@today)
  729  
  730         #Col umn Label:  Status
  731         expe ct(@landin g_appointm ents.getNt hRequestTa bleHeader( 2)).to eq( "Status")
  732         expe ct(@landin g_appointm ents.getRe questTextF orRowCol(1 ,2)).to eq ("Submitte d")
  733  
  734         #Col umn Label:  Location;
  735         expe ct(@landin g_appointm ents.getNt hRequestTa bleHeader( 3)).to eq( "Location" )
  736         expe ct(@landin g_appointm ents.getRe questTextF orRowCol(1 ,3)).to eq ("#{@@loca tionName}" )
  737  
  738         #Col umn Label:  /Type of  Care;
  739         expe ct(@landin g_appointm ents.getNt hRequestTa bleHeader( 4)).to eq( "Type of C are")
  740         expe ct(@landin g_appointm ents.getRe questTextF orRowCol(1 ,4)).to eq (PRIMARY_C ARE)
  741       end
  742  
  743       it "Sh ould verif y Provide  Feedback l ink is not  being dis played whe n Request  is accesse d from Req uest Table " do
  744         @lan ding_appoi ntments.re quest_tabl e_list_ele ments[0].c lick
  745         @com mon.waitWh ileSpinner Present
  746         expe ct(@detail .provide_f eedback_li nk_element .visible?) .to eq fal se
  747       end
  748  
  749     end
  750   end
  751  
  752  
  753  
  754  
  755