diff --git a/test/giftcard_numbering.js b/test/giftcard_numbering.js index 8eb3e54fd..cc8d95911 100644 --- a/test/giftcard_numbering.js +++ b/test/giftcard_numbering.js @@ -2,13 +2,14 @@ var assert = require("assert"); // node.js core module var ospos = require("./ospos"); describe("giftcard numbering test", function () { - this.timeout(25000); it("should be able to login", function (done) { return ospos.login(this.browser, done); }); - it("issue #65: giftcard numbering should add properly", function() { + it("issue #65: giftcard numbering should add properly", function(done) { + this.timeout(25000); + return this.browser.get(ospos.url("/index.php/giftcards")).waitForElementByCss(".big_button").click() .waitForElementByName("value", 10000).type("100").elementById('giftcard_number').clear().type("10") .elementById("submit").click().waitForElementByXPath("//table/tbody/tr[td/text()='10']/td[4]", 2000).text().then(function (value) { @@ -16,7 +17,7 @@ describe("giftcard numbering test", function () { }).elementByCss(".big_button").click().waitForElementByName("value", 4000).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!!"); - }); + }).then(done, done); }); }); diff --git a/test/make_item.js b/test/make_item.js new file mode 100644 index 000000000..b80be2dab --- /dev/null +++ b/test/make_item.js @@ -0,0 +1,17 @@ +var assert = require('assert'); +var ospos = require('./ospos'); + +describe("create item", function () { + + it("should be able to add new item", function (done) { + return this.browser.get(ospos.url("/index.php/items")).elementByCssSelector("a[title='New Item']", 5000).click() + .waitForElementByName("name", 10000).type("anItem").elementById("category").type("aCategory") + .elementById('cost_price', 2000).clear().type("10").elementById("unit_price", 2000).type("20") + .elementById('tax_name_1', 2000).type('VAT').elementById("tax_percent_name_1", 2000).type("21") + .elementById("1_quantity", 2000).type("1").elementById("reorder_level", 2000).type("0").elementById("submit", 2000).click() + .waitForElementByXPath("//table/tbody/tr[td/text()='anItem']/td[3]").text().then(function (value) { + assert.equal(value, "anItem", "item could not be created!!"); + }).then(done, done); + }); + +}); \ No newline at end of file diff --git a/test/make_sale.js b/test/make_sale.js deleted file mode 100644 index b63620330..000000000 --- a/test/make_sale.js +++ /dev/null @@ -1,13 +0,0 @@ -var assert = require('assert'); -var ospos = require('./ospos'); - -describe("create item", function () { - - it("should be able to add new item", function (done) { - return this.browser.get(ospos.url("/index.php/items")).waitForElement("a[title='New Item']", 5000).click() - .waitForElementByName("name", 10000).type("anItem").elementById('cost_price', 2000).clear().type("10").elementById("unit_price", 2000).type("20") - .elementById('tax_name_1', 2000).type('VAT').elementById("tax_percent_name_1", 2000).type("21") - .elementById("1_quantity", 2000).type("1").elementById("reorder_level", 2000).type("0").elementById("submit", 2000).click(); - }); - -}); \ No newline at end of file