<img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=1063935717132479&amp;ev=PageView&amp;noscript=1 https://www.facebook.com/tr?id=1063935717132479&amp;ev=PageView&amp;noscript=1 "> Bitovi Blog - UX and UI design, JavaScript and Front-end development
Loading

Bitovi |

FuncUnit Infographic

FuncUnit Infographic

Justin Meyer

Justin Meyer

Twitter Reddit

FuncUnit is pretty awesome. But it might not be clear how it works in Browser vs Command (Selenium) mode. To help, I put together 2 quick illustrations that highlight what's going on.

First, lets look at what happens when you open a FuncUnit test page with your browser:

Browser Mode

Browserflow

Essentially, 'S' provides a bunch of methods for selecting elements in a popup window and performing actions on them or getting information about them. QUnit is used for reporting and conditionals.

Lets see what happens in Command Mode:

Commandflow

In command mode, we use Envjs to open the same FuncUnit page. Envjs is a 'headless' browser. A headless browser is a browser that runs in a command line and you can't see the rendered page. But you CAN interact with the page with JavaScript.

When a FuncUnit page is opened up with Envjs, it knows to start Selenium. Then when your tests are run, they use Selenium to issue commands to the popup window. By using Envjs Selenium, we automated the same process that happens in "Browser" mode.

Conclusion

I hope this is helpful. It's rather rough. But if you find these 'infographics' helpful, we will produce more of them.