Skip to content

Instantly share code, notes, and snippets.

@grawk
Created May 27, 2014 17:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grawk/ea8e824d6d2e9f82329e to your computer and use it in GitHub Desktop.
Save grawk/ea8e824d6d2e9f82329e to your computer and use it in GitHub Desktop.
/*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