Intern Functional Example2


// Intern - Functional Testing - Example:

    name: 'index',

    'greeting form': function () {
        return this.remote
            .findByCssSelector('#loginForm input[type=submit]')
            .then(function (text) {
                assert.strictEqual(text, 'Hello, Elaine!',
                    'Greeting should be displayed when the form is submitted');

In the above code, what is going on with the .end() method?  Notice that we do 
not specify the selector with the click method.  The find methods probably 
returns an object that implement the Promise API but also encapsulate the 
selector and support the click method, and the .end method, and the .end method 
is responsible for resolving the promise.

Also notice the .setFindTimeout method is invoked.

The find methods implicitly / automatically waits for the element to become 
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License