Produced by Araxis Merge on 2/17/2017 4:28:02 PM 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 | VSA P2.5 v3.0.12.zip\src.zip\vsa_vistajs_source_v3.0\vsa-rpc-wizard-application\public\vsa-rpc-wizard\bower_components\typeahead.js\test\integration | test.js | Mon Jan 16 23:06:40 2017 UTC |
| 2 | VSA P2.5 v3.0.12.zip\src.zip\vsa_vistajs_source_v3.0\vsa-rpc-wizard-application\public\vsa-rpc-wizard\bower_components\typeahead.js\test\integration | test.js | Fri Feb 17 22:06:03 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 3 | 786 |
| Changed | 2 | 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 | /* jshint esnext: tr ue, evil: true, sub: true */ | |
| 2 | ||
| 3 | var wd = r equire('yi ewd'), | |
| 4 | colors = require ('colors') , | |
| 5 | expect = require ('chai').e xpect, | |
| 6 | _ = re quire('und erscore'), | |
| 7 | f = re quire('uti l').format , | |
| 8 | env = process.en v; | |
| 9 | ||
| 10 | var browse r, caps; | |
| 11 | ||
| 12 | browser = (process.e nv.BROWSER || 'chrom e').split( ':'); | |
| 13 | ||
| 14 | caps = { | |
| 15 | name: f( '[%s] type ahead.js u i', browse r.join(' , ')), | |
| 16 | browserN ame: brows er[0] | |
| 17 | }; | |
| 18 | ||
| 19 | setIf(caps , 'version ', browser [1]); | |
| 20 | setIf(caps , 'platfor m', browse r[2]); | |
| 21 | setIf(caps , 'tunnel- identifier ', env['TR AVIS_JOB_N UMBER']); | |
| 22 | setIf(caps , 'build', env['TRAV IS_BUILD_N UMBER']); | |
| 23 | setIf(caps , 'tags', env['CI'] ? ['CI'] : ['local'] ); | |
| 24 | ||
| 25 | function s etIf(obj, key, val) { | |
| 26 | val && ( obj[key] = val); | |
| 27 | } | |
| 28 | ||
| 29 | describe(' jquery-typ eahead.js' , function () { | |
| 30 | var driv er, body, input, hin t, dropdow n, allPass ed = true; | |
| 31 | ||
| 32 | this.tim eout(30000 0); | |
| 33 | ||
| 34 | before(f unction(do ne) { | |
| 35 | var host = 'ondemand .saucelabs .com', por t =
|
|
| 36 | ||
| 37 | if (en v['CI']) { | |
| 38 | host = 'localh ost'; | |
| 39 | port =
|
|
| 40 | user name = env ['SAUCE_US ERNAME']; | |
| 41 | pass word = env ['SAUCE_AC CESS_KEY'] ; | |
| 42 | } | |
| 43 | ||
| 44 | driver = wd.remo te(host, p ort, usern ame, passw ord); | |
| 45 | driver .configure Http({ | |
| 46 | time out: 30000 , | |
| 47 | retr ies: 5, | |
| 48 | retr yDelay: 20 0 | |
| 49 | }); | |
| 50 | ||
| 51 | driver .on('statu s', functi on(info) { | |
| 52 | cons ole.log(in fo.cyan); | |
| 53 | }); | |
| 54 | ||
| 55 | driver .on('comma nd', funct ion(meth, path, data ) { | |
| 56 | cons ole.log(' > ' + meth .yellow, p ath.grey, data || '' ); | |
| 57 | }); | |
| 58 | ||
| 59 | driver .run(funct ion*() { | |
| 60 | yiel d this.ini t(caps); | |
| 61 | yiel d this.get ('http://l ocalhost:8 888/test/i ntegration /test.html '); | |
| 62 | ||
| 63 | body = yield t his.elemen tByTagName ('body'); | |
| 64 | inpu t = yield this.eleme ntById('st ates'); | |
| 65 | hint = yield t his.elemen tByClassNa me('tt-hin t'); | |
| 66 | drop down = yie ld this.el ementByCla ssName('tt -menu'); | |
| 67 | ||
| 68 | done (); | |
| 69 | }); | |
| 70 | }); | |
| 71 | ||
| 72 | afterEac h(function (done) { | |
| 73 | allPas sed = allP assed && ( this.curre ntTest.sta te === 'pa ssed'); | |
| 74 | ||
| 75 | driver .run(funct ion*() { | |
| 76 | yiel d body.cli ck(); | |
| 77 | yiel d this.exe cute('wind ow.jQuery( "#states") .typeahead ("val", "" )'); | |
| 78 | done (); | |
| 79 | }); | |
| 80 | }); | |
| 81 | ||
| 82 | after(fu nction(don e) { | |
| 83 | driver .run(funct ion*() { | |
| 84 | yiel d this.qui t(); | |
| 85 | yiel d driver.s auceJobSta tus(allPas sed); | |
| 86 | done (); | |
| 87 | }); | |
| 88 | }); | |
| 89 | ||
| 90 | describe ('on blur' , function () { | |
| 91 | it('sh ould close dropdown' , function (done) { | |
| 92 | driv er.run(fun ction*() { | |
| 93 | yi eld input. click(); | |
| 94 | yi eld input. type('mi') ; | |
| 95 | ex pect(yield dropdown. isDisplaye d()).to.eq ual(true); | |
| 96 | ||
| 97 | yi eld body.c lick(); | |
| 98 | ex pect(yield dropdown. isDisplaye d()).to.eq ual(false) ; | |
| 99 | ||
| 100 | do ne(); | |
| 101 | }); | |
| 102 | }); | |
| 103 | ||
| 104 | it('sh ould clear hint', fu nction(don e) { | |
| 105 | driv er.run(fun ction*() { | |
| 106 | yi eld input. click(); | |
| 107 | yi eld input. type('mi') ; | |
| 108 | ex pect(yield hint.getV alue()).to .equal('mi chigan'); | |
| 109 | ||
| 110 | yi eld body.c lick(); | |
| 111 | ex pect(yield hint.getV alue()).to .equal('') ; | |
| 112 | ||
| 113 | do ne(); | |
| 114 | }); | |
| 115 | }); | |
| 116 | }); | |
| 117 | ||
| 118 | describe ('on query change', function() { | |
| 119 | it('sh ould open dropdown i f suggesti ons', func tion(done) { | |
| 120 | driv er.run(fun ction*() { | |
| 121 | yi eld input. click(); | |
| 122 | yi eld input. type('mi') ; | |
| 123 | ||
| 124 | ex pect(yield dropdown. isDisplaye d()).to.eq ual(true); | |
| 125 | ||
| 126 | do ne(); | |
| 127 | }); | |
| 128 | }); | |
| 129 | ||
| 130 | it('sh ould close dropdown if no sugg estions', function(d one) { | |
| 131 | driv er.run(fun ction*() { | |
| 132 | yi eld input. click(); | |
| 133 | yi eld input. type('huh? '); | |
| 134 | ||
| 135 | ex pect(yield dropdown. isDisplaye d()).to.eq ual(false) ; | |
| 136 | ||
| 137 | do ne(); | |
| 138 | }); | |
| 139 | }); | |
| 140 | ||
| 141 | it('sh ould rende r suggesti ons if sug gestions', function( done) { | |
| 142 | driv er.run(fun ction*() { | |
| 143 | va r suggesti ons; | |
| 144 | ||
| 145 | yi eld input. click(); | |
| 146 | yi eld input. type('mi') ; | |
| 147 | ||
| 148 | su ggestions = yield dr opdown.ele mentsByCla ssName('tt -suggestio n'); | |
| 149 | ||
| 150 | ex pect(sugge stions).to .have.leng th('4'); | |
| 151 | ex pect(yield suggestio ns[0].text ()).to.equ al('Michig an'); | |
| 152 | ex pect(yield suggestio ns[1].text ()).to.equ al('Minnes ota'); | |
| 153 | ex pect(yield suggestio ns[2].text ()).to.equ al('Missis sippi'); | |
| 154 | ex pect(yield suggestio ns[3].text ()).to.equ al('Missou ri'); | |
| 155 | ||
| 156 | do ne(); | |
| 157 | }); | |
| 158 | }); | |
| 159 | ||
| 160 | it('sh ould show hint if to p suggesti on is a ma tch', func tion(done) { | |
| 161 | driv er.run(fun ction*() { | |
| 162 | yi eld input. click(); | |
| 163 | yi eld input. type('mi') ; | |
| 164 | ||
| 165 | ex pect(yield hint.getV alue()).to .equal('mi chigan'); | |
| 166 | ||
| 167 | do ne(); | |
| 168 | }); | |
| 169 | }); | |
| 170 | ||
| 171 | it('sh ould match hint to q uery', fun ction(done ) { | |
| 172 | driv er.run(fun ction*() { | |
| 173 | yi eld input. click(); | |
| 174 | yi eld input. type('NeW JE'); | |
| 175 | ||
| 176 | ex pect(yield hint.getV alue()).to .equal('Ne W JErse y'); | |
| 177 | ||
| 178 | do ne(); | |
| 179 | }); | |
| 180 | }); | |
| 181 | ||
| 182 | it('sh ould not s how hint i f top sugg estion is not a matc h', functi on(done) { | |
| 183 | driv er.run(fun ction*() { | |
| 184 | yi eld input. click(); | |
| 185 | yi eld input. type('ham' ); | |
| 186 | ||
| 187 | ex pect(yield hint.getV alue()).to .equal('') ; | |
| 188 | ||
| 189 | do ne(); | |
| 190 | }); | |
| 191 | }); | |
| 192 | ||
| 193 | it('sh ould not s how hint i f there is query ove rflow', fu nction(don e) { | |
| 194 | driv er.run(fun ction*() { | |
| 195 | yi eld input. click(); | |
| 196 | yi eld input. type('this is a very lon g value so ') ; | |
| 197 | ||
| 198 | ex pect(yield hint.getV alue()).to .equal('') ; | |
| 199 | ||
| 200 | do ne(); | |
| 201 | }); | |
| 202 | }); | |
| 203 | }); | |
| 204 | ||
| 205 | describe ('on up ar row', func tion() { | |
| 206 | it('sh ould cycle through s uggestions ', functio n(done) { | |
| 207 | driv er.run(fun ction*() { | |
| 208 | va r suggesti ons; | |
| 209 | ||
| 210 | yi eld input. click(); | |
| 211 | yi eld input. type('mi') ; | |
| 212 | ||
| 213 | su ggestions = yield dr opdown.ele mentsByCla ssName('tt -suggestio n'); | |
| 214 | ||
| 215 | yi eld input. type(wd.SP ECIAL_KEYS ['Up arrow ']); | |
| 216 | ex pect(yield input.get Value()).t o.equal('M issouri'); | |
| 217 | ex pect(yield suggestio ns[3].getA ttribute(' class')).t o.equal('t t-suggesti on tt-sele ctable tt- cursor'); | |
| 218 | ||
| 219 | yi eld input. type(wd.SP ECIAL_KEYS ['Up arrow ']); | |
| 220 | ex pect(yield input.get Value()).t o.equal('M ississippi '); | |
| 221 | ex pect(yield suggestio ns[2].getA ttribute(' class')).t o.equal('t t-suggesti on tt-sele ctable tt- cursor'); | |
| 222 | ||
| 223 | yi eld input. type(wd.SP ECIAL_KEYS ['Up arrow ']); | |
| 224 | ex pect(yield input.get Value()).t o.equal('M innesota') ; | |
| 225 | ex pect(yield suggestio ns[1].getA ttribute(' class')).t o.equal('t t-suggesti on tt-sele ctable tt- cursor'); | |
| 226 | ||
| 227 | yi eld input. type(wd.SP ECIAL_KEYS ['Up arrow ']); | |
| 228 | ex pect(yield input.get Value()).t o.equal('M ichigan'); | |
| 229 | ex pect(yield suggestio ns[0].getA ttribute(' class')).t o.equal('t t-suggesti on tt-sele ctable tt- cursor'); | |
| 230 | ||
| 231 | yi eld input. type(wd.SP ECIAL_KEYS ['Up arrow ']); | |
| 232 | ex pect(yield input.get Value()).t o.equal('m i'); | |
| 233 | ex pect(yield suggestio ns[0].getA ttribute(' class')).t o.equal('t t-suggesti on tt-sele ctable'); | |
| 234 | ex pect(yield suggestio ns[1].getA ttribute(' class')).t o.equal('t t-suggesti on tt-sele ctable'); | |
| 235 | ex pect(yield suggestio ns[2].getA ttribute(' class')).t o.equal('t t-suggesti on tt-sele ctable'); | |
| 236 | ex pect(yield suggestio ns[3].getA ttribute(' class')).t o.equal('t t-suggesti on tt-sele ctable'); | |
| 237 | ||
| 238 | do ne(); | |
| 239 | }); | |
| 240 | }); | |
| 241 | }); | |
| 242 | ||
| 243 | describe ('on down arrow', fu nction() { | |
| 244 | it('sh ould cycle through s uggestions ', functio n(done) { | |
| 245 | driv er.run(fun ction*() { | |
| 246 | va r suggesti ons; | |
| 247 | ||
| 248 | yi eld input. click(); | |
| 249 | yi eld input. type('mi') ; | |
| 250 | ||
| 251 | su ggestions = yield dr opdown.ele mentsByCla ssName('tt -suggestio n'); | |
| 252 | ||
| 253 | yi eld input. type(wd.SP ECIAL_KEYS ['Down arr ow']); | |
| 254 | ex pect(yield input.get Value()).t o.equal('M ichigan'); | |
| 255 | ex pect(yield suggestio ns[0].getA ttribute(' class')).t o.equal('t t-suggesti on tt-sele ctable tt- cursor'); | |
| 256 | ||
| 257 | yi eld input. type(wd.SP ECIAL_KEYS ['Down arr ow']); | |
| 258 | ex pect(yield input.get Value()).t o.equal('M innesota') ; | |
| 259 | ex pect(yield suggestio ns[1].getA ttribute(' class')).t o.equal('t t-suggesti on tt-sele ctable tt- cursor'); | |
| 260 | ||
| 261 | yi eld input. type(wd.SP ECIAL_KEYS ['Down arr ow']); | |
| 262 | ex pect(yield input.get Value()).t o.equal('M ississippi '); | |
| 263 | ex pect(yield suggestio ns[2].getA ttribute(' class')).t o.equal('t t-suggesti on tt-sele ctable tt- cursor'); | |
| 264 | ||
| 265 | yi eld input. type(wd.SP ECIAL_KEYS ['Down arr ow']); | |
| 266 | ex pect(yield input.get Value()).t o.equal('M issouri'); | |
| 267 | ex pect(yield suggestio ns[3].getA ttribute(' class')).t o.equal('t t-suggesti on tt-sele ctable tt- cursor'); | |
| 268 | ||
| 269 | yi eld input. type(wd.SP ECIAL_KEYS ['Down arr ow']); | |
| 270 | ex pect(yield input.get Value()).t o.equal('m i'); | |
| 271 | ex pect(yield suggestio ns[0].getA ttribute(' class')).t o.equal('t t-suggesti on tt-sele ctable'); | |
| 272 | ex pect(yield suggestio ns[1].getA ttribute(' class')).t o.equal('t t-suggesti on tt-sele ctable'); | |
| 273 | ex pect(yield suggestio ns[2].getA ttribute(' class')).t o.equal('t t-suggesti on tt-sele ctable'); | |
| 274 | ex pect(yield suggestio ns[3].getA ttribute(' class')).t o.equal('t t-suggesti on tt-sele ctable'); | |
| 275 | ||
| 276 | do ne(); | |
| 277 | }); | |
| 278 | }); | |
| 279 | }); | |
| 280 | ||
| 281 | describe ('on escap e', functi on() { | |
| 282 | it('sh ould close dropdown' , function (done) { | |
| 283 | driv er.run(fun ction*() { | |
| 284 | yi eld input. click(); | |
| 285 | yi eld input. type('mi') ; | |
| 286 | ex pect(yield dropdown. isDisplaye d()).to.eq ual(true); | |
| 287 | ||
| 288 | yi eld input. type(wd.SP ECIAL_KEYS ['Escape'] ); | |
| 289 | ex pect(yield dropdown. isDisplaye d()).to.eq ual(false) ; | |
| 290 | ||
| 291 | do ne(); | |
| 292 | }); | |
| 293 | }); | |
| 294 | ||
| 295 | it('sh ould clear hint', fu nction(don e) { | |
| 296 | driv er.run(fun ction*() { | |
| 297 | yi eld input. click(); | |
| 298 | yi eld input. type('mi') ; | |
| 299 | ex pect(yield hint.getV alue()).to .equal('mi chigan'); | |
| 300 | ||
| 301 | yi eld input. type(wd.SP ECIAL_KEYS ['Escape'] ); | |
| 302 | ex pect(yield hint.getV alue()).to .equal('') ; | |
| 303 | ||
| 304 | do ne(); | |
| 305 | }); | |
| 306 | }); | |
| 307 | }); | |
| 308 | ||
| 309 | describe ('on tab', function( ) { | |
| 310 | it('sh ould autoc omplete if hint is p resent', f unction(do ne) { | |
| 311 | driv er.run(fun ction*() { | |
| 312 | yi eld input. click(); | |
| 313 | yi eld input. type('mi') ; | |
| 314 | ||
| 315 | yi eld input. type(wd.SP ECIAL_KEYS ['Tab']); | |
| 316 | ex pect(yield input.get Value()).t o.equal('M ichigan'); | |
| 317 | ||
| 318 | do ne(); | |
| 319 | }); | |
| 320 | }); | |
| 321 | ||
| 322 | it('sh ould selec t if curso r is on su ggestion', function( done) { | |
| 323 | driv er.run(fun ction*() { | |
| 324 | va r suggesti ons; | |
| 325 | ||
| 326 | yi eld input. click(); | |
| 327 | yi eld input. type('mi') ; | |
| 328 | ||
| 329 | su ggestions = yield dr opdown.ele mentsByCla ssName('tt -suggestio n'); | |
| 330 | yi eld input. type(wd.SP ECIAL_KEYS ['Down arr ow']); | |
| 331 | yi eld input. type(wd.SP ECIAL_KEYS ['Down arr ow']); | |
| 332 | yi eld input. type(wd.SP ECIAL_KEYS ['Tab']); | |
| 333 | ||
| 334 | ex pect(yield dropdown. isDisplaye d()).to.eq ual(false) ; | |
| 335 | ex pect(yield input.get Value()).t o.equal('M innesota') ; | |
| 336 | ||
| 337 | do ne(); | |
| 338 | }); | |
| 339 | }); | |
| 340 | }); | |
| 341 | ||
| 342 | describe ('on right arrow', f unction() { | |
| 343 | it('sh ould autoc omplete if hint is p resent', f unction(do ne) { | |
| 344 | driv er.run(fun ction*() { | |
| 345 | yi eld input. click(); | |
| 346 | yi eld input. type('mi') ; | |
| 347 | ||
| 348 | yi eld input. type(wd.SP ECIAL_KEYS ['Right ar row']); | |
| 349 | ex pect(yield input.get Value()).t o.equal('M ichigan'); | |
| 350 | ||
| 351 | do ne(); | |
| 352 | }); | |
| 353 | }); | |
| 354 | }); | |
| 355 | ||
| 356 | describe ('on sugge stion clic k', functi on() { | |
| 357 | it('sh ould selec t suggesti on', funct ion(done) { | |
| 358 | driv er.run(fun ction*() { | |
| 359 | va r suggesti ons; | |
| 360 | ||
| 361 | yi eld input. click(); | |
| 362 | yi eld input. type('mi') ; | |
| 363 | ||
| 364 | su ggestions = yield dr opdown.ele mentsByCla ssName('tt -suggestio n'); | |
| 365 | yi eld sugges tions[1].c lick(); | |
| 366 | ||
| 367 | ex pect(yield dropdown. isDisplaye d()).to.eq ual(false) ; | |
| 368 | ex pect(yield input.get Value()).t o.equal('M innesota') ; | |
| 369 | ||
| 370 | do ne(); | |
| 371 | }); | |
| 372 | }); | |
| 373 | }); | |
| 374 | ||
| 375 | describe ('on enter ', functio n() { | |
| 376 | it('sh ould selec t if curso r is on su ggestion', function( done) { | |
| 377 | driv er.run(fun ction*() { | |
| 378 | va r suggesti ons; | |
| 379 | ||
| 380 | yi eld input. click(); | |
| 381 | yi eld input. type('mi') ; | |
| 382 | ||
| 383 | su ggestions = yield dr opdown.ele mentsByCla ssName('tt -suggestio n'); | |
| 384 | yi eld input. type(wd.SP ECIAL_KEYS ['Down arr ow']); | |
| 385 | yi eld input. type(wd.SP ECIAL_KEYS ['Down arr ow']); | |
| 386 | yi eld input. type(wd.SP ECIAL_KEYS ['Return'] ); | |
| 387 | ||
| 388 | ex pect(yield dropdown. isDisplaye d()).to.eq ual(false) ; | |
| 389 | ex pect(yield input.get Value()).t o.equal('M innesota') ; | |
| 390 | ||
| 391 | do ne(); | |
| 392 | }); | |
| 393 | }); | |
| 394 | }); | |
| 395 | }); |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.