www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

README.md (2545B)


      1 # How to generate screenshotter images
      2 
      3 ## Automatic generation of screen shots
      4 
      5 Now you too can generate screenshots from your own computer, and (hopefully)
      6 have them look mostly the same as the current ones! Make sure you have docker
      7 installed and running.
      8 If all you want is (re)create
      9 all the snapshots for all the browsers, then you can do so by running the
     10 `screenshotter.sh` script:
     11 
     12     dockers/Screenshotter/screenshotter.sh
     13 
     14 It will fetch all required selenium docker images, and use them to
     15 take screenshots.
     16 
     17 ## Manual generation
     18 
     19 If you are creating screenshots on a regular basis, you can keep the
     20 docker containers with the selenium setups running.  Essentially you
     21 are encouraged to reproduce the steps from `screenshotter.sh`
     22 manually.  Example run for Firefox:
     23 
     24     container=$(docker run -d -P selenium/standalone-firefox:2.46.0)
     25     node dockers/Screenshotter/screenshotter.js -b firefox -c ${container}
     26     # possibly repeat the above command as often as you need, then eventually
     27     docker stop ${container}
     28     docker rm ${container}
     29 
     30 For Chrome, simply replace both occurrences of `firefox` with `chrome`.
     31 
     32 ## Use without docker
     33 
     34 It is possible to run `screenshotter.js` without the use of Docker:
     35 
     36     npm install selenium-webdriver
     37     node dockers/Screenshotter/screenshotter.js
     38 
     39 This will generate screenshots using the Firefox installed on your system.
     40 Browsers other than Firefox can be targeted using the `--browser` option.
     41 For a complete list of options pass `--help` as an argument to
     42 `screenshotter.js`.  Using these it should be possible to have the script
     43 connect to almost any Selenium web driver you might have access to.
     44 
     45 Note that screenshots taken without Docker are very likely to disagree
     46 from the ones stored in the repository, due to different versions of
     47 various software components being used.  The screenshots taken in this
     48 fashion are well suited for visual inspection, but for exact binary
     49 comparisons it would be neccessary to carefully set up the environment
     50 to match the one used by the Docker approach.
     51 
     52 ## Choosing the list of test cases
     53 
     54 Both `screenshotter.js` and `screenshotter.sh` will accept
     55 an `--include` option (short `-i`) which can be used to specify
     56 a list of test cases to be processed, as a comma separated list.
     57 Conversely, the `--exclude` option (short `-x`) can be used
     58 to specify a list of cases which are not being processed.
     59 
     60 Examples:
     61 
     62     node dockers/Screenshotter/screenshotter.js -i Sqrt,SqrtRoot
     63     dockers/Screenshotter/screenshotter.sh --exclude=GreekLetters