Skip to content

Instantly share code, notes, and snippets.

@miketheprogrammer
Created April 29, 2014 20:02
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 miketheprogrammer/52dab2beb1d7cea7981c to your computer and use it in GitHub Desktop.
Save miketheprogrammer/52dab2beb1d7cea7981c to your computer and use it in GitHub Desktop.
poop
var util = require('util');
var client = argument[0]
config = {
clients: {
demo: {
url: 'demo.cc.com'
},
amex: {
url: 'amex.cc.com'
},
chipotle: {
url: 'chipotle.cc.com'
}
}
core: {
pages: {
login: {
url: '/login',
credentials: {
username: 'michael',
password: 'hernandez'
}
}
}
}
}
/** TEST **/
describe("Index Page", function () {
beforeEach(function () {
var loginPage = new LoginPage();
loginPage.open();
loginPage.doLogin();
})
//
it ('Thjere are 3', function () {
Driver.assert(nextPage.is('/index'));
var indexPage = new IndexPage();
indexPage.checkUsers();
});
// CLick first
})
function BasePage() {
}
BasePage.prototype.open = function () {
Driver.open(config[client].url + config.pages.login.url);
}
/** Login Controller */
function LoginPage ( ) {
this.model = new LoginModel();
BasePage.call(this);
}
util.inherit(BasePage, LoginPage);
LoginPage.protoype.doLogin = function () {
this.model.getUsernameField().text = config.pages.login.credentials.username;
this.model.getPasswordField().text = config.pages.login.credentials.password;
}
function IndexPage () {
BasePage.call(this);
}
util.inherits(BasePage, IndexPage);
/** Model **/
function LoginModel() {
}
LoginModel.prototype.getUsernameField = function () {
return driver.getElementByXpath('//username');
}
LoginModel.prototype.setUsernameField = function(value) {
return driver.setElementTExtByXpath('//username', value);
}
LoginModel.prototype.getPasswordField = function () {
return driver.getElementByXpath('//password');
}
@poopiman
Copy link

hi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment