JSConf 2014

Automatizando los tests en los navegadores

John-David Dalton  · 

Transcripción

Extracto de la transcripción automática del vídeo realizada por YouTube.

hi I'm John David Dalton and today I'm going to be talking about fearless browser test automation so a little bit of background I am a contributor to lodash lodash is a before I begin how many people use lodash alright are how many people use underscore

all right get out get out it's ready yes no that's okay you can stay I also help and contribute to underscore too but today I'm going to be talking about browser test automation and what I did with lodash to to tackle that when i created lodash

one of the things i wanted to do today to separate myself from the competition was to list the browser's I test and that meant testing those browsers and so when I first released lodash I was very accommodating to testing lots of browsers I said I support

chrome 5 and i support firefox what is it now 29 or something like all the ranges all the browsers and that meant testing all of those things and so that took about two days to do and we had 38 or 34 releases in that year which meant a lot of time spent testing

and I knew there had to be a better way but before I start j/s comp is a conference of firsts I started lodash after j/s comp one year and I was inspired by Jen's talk on George sort so I'd like to announce that we will be getting short by it's

a it's a drop-in replacement for George sort but it is faster and more consistent yeah thank you all right you can follow along and some of the the Q A's of the my testing story at sauce labs they did a blog post where I answer a lot of the questions

I'll be talking about today so there's the short URL there bit ly / sauce hyphen loaded with no hyphen on the low dash all right manual testing made me do this it was horrible it's lots of browsers its variations its versions its virtual machines

and it's time so I mentioned that I test a lot of browsers and I'm sure everyone's setup looks like this so we all have our Chrome browsers right okay we all have our I ease we all have our firefox's our operas and our safaris and I tested

on all of those manually opening up the browser going to the unit tests running the unit tests doing a drop-down menu to change out the file in the build and doing that over and over and over and over again and that just sucked up my weekends so so I wanted

to automate this but the problem was it was intimidating there wasn't a lot of documentation around browser test automation I noticed that it seemed to be mysterious and very hard in fact I could not do it I had to ask the twittersphere for help and someone

actually jumped in and fixed bugs in dependencies of NPM packages and to get it to work for me and then once they did that then I was able to kind of refine it and clean it up and I took it on from there and so I'm going to be covering some of the roadblocks

that Iran into getting testing started so let me go back all right if you noticed I had a lot of virtual machines to that eats up my hard drive this box is basically just good for javascript there's almost no hard drive space left it's all just VMs

all right so lodash tests on five browsers that's five environments so it's not just it's not just note or the browser's it's Ringo Rhino norwall I'm about to do Nagy horn which is like the new rhino and I even test on things like adobe

illustrator but that's not included in my automation I just manually do that one there's also build so it's not just the monolithic bill because we've had a lot of talks on modules right so lodash supports custom builds we're one of the

most customized libraries out there so there's the AMD build there's the common j/s build which is different than the MPN build and all of these are tested and they all run in the same unit test so I have one unit test file and every single one of

these bills can run against that unit test so I know that each one's covered and testing it in the browser it's the same thing it's not just the monolithic build it's the AMD built it's the underscore build it's the backbone build its

it's the comic the compat build it's the modern build it's the non minified version it's the minified version of each one of these things because bugs creep in to lots of different areas closure compiler Advanced Mode likes to think it knows

more than you do and will say hey this code can never be reached but engines are buggy and lots of places where code can should never be reached can get reached if you're doing a feature test and so close your compiler will like to strip out those feature

tests so I have to put them back in and I have unit tests to make sure that the minified versions work correctly this says 30 versions i have since pulled back because even automating it that's still a crazy amount of browsers so i follow the jquery a

[ ... ]

Nota: se han omitido las otras 2.312 palabras de la transcripción completa para cumplir con las normas de «uso razonable» de YouTube.