-
-
Save miketheprogrammer/52dab2beb1d7cea7981c to your computer and use it in GitHub Desktop.
poop
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
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'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hi