mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-03-06 16:18:14 -05:00
Add giftcard numbering test
This commit is contained in:
43
test/giftcard_numbering.js
Normal file
43
test/giftcard_numbering.js
Normal file
@@ -0,0 +1,43 @@
|
||||
var assert = require("assert"); // node.js core module
|
||||
|
||||
describe("giftcard numbering test", function () {
|
||||
|
||||
var server = "http://localhost/pos";
|
||||
|
||||
var url = function url(suffix) {
|
||||
return server + suffix + "?XDEBUG_SESSION_START=ECLIPSE_DBGP&KEY=14241668456852'";
|
||||
};
|
||||
|
||||
it("should be able to login", function (done) {
|
||||
return this.browser.get(url("/index.php"))
|
||||
.elementByName('username').type("admin").getValue()
|
||||
.then(function(value) {
|
||||
assert.equal(value, "admin");
|
||||
})
|
||||
.elementByName('password').type("pointofsale").getValue()
|
||||
.then(function(value) {
|
||||
assert.ok(value, "pointofsale");
|
||||
})
|
||||
.elementByName('loginButton').click()
|
||||
.elementById('home_module_list').then(function(value) {
|
||||
assert.ok(value, "Login failed!!")
|
||||
})
|
||||
.then(done, done);
|
||||
|
||||
});
|
||||
|
||||
for (var i=1; i < 12; i++) {
|
||||
|
||||
var evaluate = (function(i, browser) {
|
||||
return function() {
|
||||
return this.browser.get(url("/index.php/giftcards")).waitForElementByCss(".big_button").click()
|
||||
.waitForElementByName("value").type("100")
|
||||
.elementById("submit").click().waitForElementById("giftcard_" + i, 100, 2000).then(function(value) {
|
||||
assert.ok(value, "Giftcard failed to be added properly!");
|
||||
});
|
||||
}})(i);
|
||||
it("gitftcard numbering should add up fine " + i, evaluate);
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
@@ -1,26 +0,0 @@
|
||||
var assert = require("assert"); // node.js core module
|
||||
|
||||
describe("giftcard numbering test", function () {
|
||||
|
||||
it("giftcard numbering should increment", function (done) {
|
||||
|
||||
var searchBox;
|
||||
var browser = this.browser;
|
||||
browser.get('http://localhost/index.php?XDEBUG_SESSION_START=ECLIPSE_DBGP&KEY=14241668456852')
|
||||
.elementByName('username').type("admin").getValue()
|
||||
.then(function(value) {
|
||||
assert.equal(value, "admin");
|
||||
})
|
||||
.elementByName('password').type("pointofsale").getValue()
|
||||
.then(function(value) {
|
||||
assert.ok(value, "pointofsale");
|
||||
})
|
||||
.elementByName('loginButton').click()
|
||||
.elementById('home_module_list').then(function(value) {
|
||||
assert.ok(value, "Login failed!!")
|
||||
})
|
||||
.then(done, done);
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user