diff --git a/database/database.sql b/database/database.sql index 03366dd13..424358d00 100644 --- a/database/database.sql +++ b/database/database.sql @@ -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, diff --git a/test/giftcard_numbering.js b/test/giftcard_numbering.js index a799cd51a..5ca111daf 100644 --- a/test/giftcard_numbering.js +++ b/test/giftcard_numbering.js @@ -26,18 +26,15 @@ describe("giftcard numbering test", function () { }); - 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); - } - + 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!!"); + }); + }); }); diff --git a/test/login.js b/test/login.js new file mode 100644 index 000000000..35c6961ce --- /dev/null +++ b/test/login.js @@ -0,0 +1,3 @@ +exports.loginFirst = function() { + +} \ No newline at end of file diff --git a/travis-ci-apache b/travis-ci-apache index 364d1fa4f..4c93d795e 100644 --- a/travis-ci-apache +++ b/travis-ci-apache @@ -1,3 +1,4 @@ +Alias /pos %TRAVIS_BUILD_DIR% DocumentRoot %TRAVIS_BUILD_DIR%