Intern Functional Example1

intern

// Intern - Functional:

define([
    'intern!object',
    'intern/chai!assert',
    '../Request',
    'require'
], function (registerSuite, assert, Request, require) {
    var request,
        url = 'https://github.com/theintern/intern';

    registerSuite({
        name: 'demo',

        'submit form': function () {
            return this.remote
                .get(require.toUrl('./fixture.html'))
                .elementById('operation')
                    .click()
                    .type('hello, world')
                .end()
                .elementById('submit')
                    .click()
                .end()
                .waitForElementById('result')
                .text()
                .then(function (resultText) {
                    assert.ok(
                      resultText.indexOf('"hello, world" completed successfully') > -1, 
                     'When form is submitted, operation should complete successfully');
                });
        }
    });
});
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License