Get help with testing, discuss unit testing strategies etc.


Post by nickolay »

So, the latest and the greatest Siesta 1.0.7 is out.

For a full changelog please refer to https://bryntum.com/products/siesta/changelog/?id=1.0.7, I'd just like to highlight couple of the most interesting new features.

- First of all, we've added a long awaited chaining for testing asynchronous code. It should dramatically reduce the nesting level of your tests.

What previously was looking as:
    t.type(userNameField, 'username', function () {
        t.type(passwordField, 'secret', function () {
            t.click(loginButton, function () {
                // done
            })
        })
    })
Now can be written as:
    t.chain(
        function (next) {
            t.type(userNameField, 'username', next)
        },
        function (next) {
            t.type(passwordField, 'secret', next)
        },
        function (next) {
            t.click(loginButton, next)
        },
        function () {
            // done
        }
    })
Or even:
    t.chain({
        action  : 'type',
        target  : userNameField, 
        text    : 'username'
    },{
        action  : 'type',
        target  : passwordField, 
        text    : 'secret'
    },{
        action  : 'click',
        target  : loginButton 
    })
See the documentation for the "t.chain" method.

- Secondly, we've added a bunch of new assertions, among then `chainClick`, `clickComponentQuery` (thanks to Zombeerose for great ideas)

- And last but not the least, PhantomJS and Selenium launchers now can report the results of the test suite execution in the JSON and JUnit (XML) formats. This should allow to use Siesta test suites in various continuous integration systems, like Jenkins, TeamCity and others.
This feature is considered experimental at this moment, please let us know how it works for you.

Enjoy the Siesta :)

Post Reply