diff --git a/Dockerfile b/Dockerfile index 23df9b96f..5578caddf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,6 @@ -FROM ubuntu:trusty +FROM ubuntu:utopic MAINTAINER jekkos +RUN sed -i -e 's/archive.ubuntu.com\|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list RUN apt-get update RUN apt-get -y upgrade RUN DEBIAN_FRONTEND=noninteractive apt-get -y install mysql-client mysql-server apache2 libapache2-mod-php5 pwgen python-setuptools vim-tiny php5-mysql php5-gd nodejs npm curl @@ -20,7 +21,6 @@ RUN npm install -g grunt-cli RUn ln -s /usr/local/bin/grunt /usr/bin/grunt RUN ln -fs /app/* /var/www/html -RUN rm /var/www/index.html ADD ./docker/start_container.sh /start_container.sh RUN chmod 755 /start_container.sh EXPOSE 80 3306 diff --git a/test/ospos.js b/test/ospos.js index a361b6386..b26f5be6f 100644 --- a/test/ospos.js +++ b/test/ospos.js @@ -2,7 +2,7 @@ var assert = require('assert'); var ospos = function() { - var server = "http://localhost/index.php"; + var server = "http://localhost"; return { @@ -10,38 +10,38 @@ var ospos = function() { return server + suffix; } , - login : function(browser, done) { - return browser.get(this.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); + login : function(browser, done) { + return browser.get(this.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); - }, + }, - create_item : function(browser, item) - { - return browser.get(this.url("/index.php/items")).elementByCssSelector("a[title='New Item']", 5000).click() - .waitForElementByName("name", 10000).type(item.name).elementById("category").type(item.category) - .elementById('cost_price', 2000).clear().type(item.cost_price).elementById("unit_price", 2000).type(item.unit_price) - .elementById('tax_name_1', 2000).type('VAT').elementById("tax_percent_name_1", 2000).type("21") - .elementById('receiving_quantity', 2000).type(item.receiving_quantity || 1) - .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 " + item.name + " could not be created!!"); - }); - } + create_item : function(browser, item) + { + return browser.get(this.url("/index.php/items")).elementByCssSelector("a[title='New Item']", 5000).click() + .waitForElementByName("name", 10000).type(item.name).elementById("category").type(item.category) + .elementById('cost_price', 2000).clear().type(item.cost_price).elementById("unit_price", 2000).type(item.unit_price) + .elementById('tax_name_1', 2000).type('VAT').elementById("tax_percent_name_1", 2000).type("21") + .elementById('receiving_quantity', 2000).type(item.receiving_quantity || 1) + .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 " + item.name + " could not be created!!"); + }); + } } }; -module.exports = ospos(); \ No newline at end of file +module.exports = ospos();