📜 ⬆️ ⬇️

Syn is a library of synthetic events that makes testing easier.

The Jupiter IT team has released Syn , a library that allows you to create synthetic events for use in testing. This separate library is designed to assist in the testing of complex user interface behavior by simulating user actions, such as typing with the keyboard, clicking the mouse buttons, and dragging with it.

Testing rich, dynamic web applications is a tricky business. In our company, we tried almost all available solutions for testing (qUnit, Quick Test Pro, Selenium, JsUnit, Env.js, TestCase), and they all suffer from fatal flaws.

Problems:
  • Manual - The tester must manually run tests in each supported browser. People are lazy;
  • Only unit tests - We need to test the application as a whole, as well as a complex user interface, including such nuances as drag and drop behavior;
  • Low accuracy - We need to make sure test reports give accurate results;
  • Difficulty of writing - We want to write tests using a convenient JS API;
  • Expensive - a QTP license costs 5K per person! It is better to pay a vacation;
  • Support - We want to test also in browsers under Mac and Linux.

We solved all these problems within the framework of a soon-coming test framework called FuncUnit. This is a mashup from qUnit, Selenium, Rhino and Env.js. However, its main library is Syn, which performs imitations of user actions with very high accuracy, what we release today.

')
For example, using this code:
Syn.click( {}, 'hello' )
.type( 'Hello World' )
.drag( $( '#trash' ) );


* This source code was highlighted with Source Code Highlighter .

You can simulate a click on the element with the hello identifier, typing "Hello World", and then dragging the mouse from this element to the element with the trash identifier.

Just a great thing. Watch their demo to see how events are recorded and played back .

Source: https://habr.com/ru/post/99319/


All Articles