Merge branch 'feature/travis-ci'

This commit is contained in:
jekkos
2015-05-21 22:12:30 +02:00
4 changed files with 44 additions and 26 deletions

View File

@@ -121,7 +121,7 @@ INSERT INTO `ospos_employees` (`username`, `password`, `person_id`, `deleted`) V
CREATE TABLE `ospos_giftcards` (
`record_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`giftcard_id` int(11) NOT NULL AUTO_INCREMENT,
`giftcard_number` varchar(25) NOT NULL,
`giftcard_number` int(10) NOT NULL,
`value` decimal(15,2) NOT NULL,
`deleted` int(1) NOT NULL DEFAULT '0',
`person_id` INT(10) DEFAULT NULL,

View File

@@ -0,0 +1,40 @@
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);
});
it("issue #65: giftcard numbering should add properly", function() {
return this.browser.get(url("/index.php/giftcards")).waitForElementByCss(".big_button").click()
.waitForElementByName("value").type("100").elementById('giftcard_number').clear().type("10")
.elementById("submit").click().waitForElementByXPath("//table/tbody/tr[td/text()='10']/td[4]").text().then(function (value) {
assert.ok(value, "giftcard failed to be added properly!");
}).elementByCss(".big_button").click().waitForElementByName("value").type("100").elementById("submit").click()
.waitForElementByXPath("//table/tbody/tr[td/text()='11']/td[4]").text().then(function (value) {
assert.equal(value, "11", "giftcard number not incrementing properly!!");
});
});
});

View File

@@ -1,26 +1,3 @@
var assert = require("assert"); // node.js core module
exports.loginFirst = function() {
describe("giftcard numbering test", function () {
it("giftcard numbering should increment", function (done) {
var searchBox;
var browser = this.browser;
browser.get('http://localhost/pos/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);
});
});
}

View File

@@ -1,3 +1,4 @@
Alias /pos %TRAVIS_BUILD_DIR%
<VirtualHost *:80>
DocumentRoot %TRAVIS_BUILD_DIR%