Created
December 17, 2015 17:26
-
-
Save diverted247/8f30088114cc212d100a to your computer and use it in GitHub Desktop.
Intern Test JS file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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