Created
May 27, 2014 17:19
-
-
Save grawk/ea8e824d6d2e9f82329e to your computer and use it in GitHub Desktop.
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
/*global describe:true, it:true, before:true, after:true */ | |
'use strict'; | |
var nemoFactory = require('nemo-mocha-factory'), | |
plugins = require('../config/nemo-plugins'), | |
setup = { | |
"view": ['addcard'] | |
}; | |
describe('Nemo @addcardSuite@', function() { | |
nemoFactory({ | |
'plugins': plugins, | |
'setup': setup | |
}); | |
beforeEach(function(done) { | |
nemo.driver.get(nemo.props.targetBaseUrl).then(function() { | |
done(); | |
}); | |
}) | |
it('will @addcardSuccess@', function(done) { | |
//add card number, select card type, submit form, wait for result | |
var a = nemo.view.addcard; | |
//nemo.driver.get(nemo.props.targetBaseUrl); | |
a.cc().sendKeys('1234123412341234'); | |
a.typeOptionText("Misa"); | |
a.ccbutton().click(); | |
a.resultWait(6000, 'couldn\'t find a result'); | |
nemo.driver.sleep(2000); | |
a.result().getText().then(function(resultText) { | |
if (resultText.indexOf('Success') !== -1) { | |
done(); | |
} else { | |
done(new Error('Didn\'t get a success result')); | |
} | |
}); | |
}); | |
it('will @addcardFail@', function(done) { | |
//add card number, select card type, submit form, wait for result | |
var a = nemo.view.addcard; | |
//nemo.driver.get(nemo.props.targetBaseUrl); | |
a.cc().sendKeys('1001001'); | |
a.typeOptionText("Misa"); | |
a.ccbutton().click(); | |
a.resultWait(6000, 'couldn\'t find a result'); | |
nemo.driver.sleep(2000); | |
a.result().getText().then(function(resultText) { | |
if (resultText.indexOf('Unable') !== -1) { | |
done(); | |
} else { | |
done(new Error('Didn\'t get a failure result')); | |
} | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment