Code Monkey home page Code Monkey logo

webotest's Introduction

Webotest

Webotest is an npm package - automated web test, used to compare two website page screenshots - local (unpublished) un public (published). Focusing developement on multipage CMS websites (like EPiServer CMS, where CMS pages are part of website's navigation.

Webotest repository available on GitHub and Webotest package available on npm.

Prerequisites

You need to have installed npm and Node.js on your machine.

Website navigation structure has to be identical to run successful test - otherwise there is no use to run tests, as they won't bring up the necessary and proper results.
Only publicly available pages will be read in website navigation to create comparement.
NOTE: Using hyperlink `<a></a>` href data to get hierachical structure of website.
If none of the hyperlinks are detected, test won't return expected results.
NOTE: Internet connection failures can cause screenshot making issues.

Installing

npm install webotest
Package's current version works only with npm2.

Working to support it on npm3.

Running the tests

Run tests in console from webotest directory, for example: C:\Users\elinale\node_modules\webotest ... This directory also is, where all test results are saved.

There is only one command to run webotest:

node web-tester.js --localUrl=http://local_website --publicUrl=http://public_website

as in

node web-tester.js --localUrl=http://site.localtest.me --publicUrl=http://www.site.com

node web-tester.js --localUrl=http://site.localtest.me --publicUrl=http://test.site.com

node web-tester.js --localUrl=http://site.localtest.me --publicUrl=http://staging.site.com

etc.

! Always write down the protocol as shown in example, otherwise tests won't be run.

! Remember to keep in sync content between local and public websites and identical navigation structure (links), as webotest relies on that. Again, great and developed to work with websites created on EPiServer CMS basis, as it allows to import/export website contents.

Why to test?

To prevent unwanted changes in website design, ease job with bug reports - just check localhost:8082 after you get notification "Listening to localhost" in console.

! Note, that html files can be overviewed in browser while local server is running, as they are created dynamically and get data from server side.

What files will you get after test has done?

Main directory (created based on test date) with four subdirectories:

  • for local site;
  • for published site;
  • dynamically created html files (for local server);
  • image results (.png files).

Local site and public site subdirectories contain:

  • image directory with site's hierarchical page structure screenshots;
  • .json file with a list of site's hierarchical structure (URL addresses).

Author

Elina Lenova

License

This project is licensed under the MIT License.

Acknowledgments

Other npm packages also were used, to make things happen, check the package.json file to see the list of dependencies and under other_resources directory.

webotest's People

Contributors

elinale avatar arvislacis avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.