Skip to content

Instantly share code, notes, and snippets.

@diverted247
Created December 17, 2015 17:26
Show Gist options
  • Save diverted247/8f30088114cc212d100a to your computer and use it in GitHub Desktop.
Save diverted247/8f30088114cc212d100a to your computer and use it in GitHub Desktop.
Intern Test JS file
define(function (require) {
var registerSuite = require('intern!object');
var assert = require('intern/chai!assert');
registerSuite({
name: 'index',
'greeting form': function () {
return this.remote
.get(require.toUrl('index.html'))
.setFindTimeout(5000)
.findByCssSelector('body.loaded')
.findById('nameField')
.click()
.type('Elaine')
.end()
.findByCssSelector('#loginForm input[type=submit]')
.click()
.end()
.findById('greeting')
.getVisibleText()
.then(function (text) {
assert.strictEqual(text, 'Hello, Elaine!',
'Greeting should be displayed when the form is submitted');
});
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment