From c36f6b603db9a6a9534e5ebe92c350860d5104e8 Mon Sep 17 00:00:00 2001 From: jekkos Date: Mon, 25 Jan 2016 17:53:47 +0100 Subject: [PATCH 1/7] Run docker interactively in travis script step --- .travis.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index ae94dad9f..b61dc8cc0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,8 +10,6 @@ services: before_install: - docker build -t jekkos/opensourcepos . - - docker run -d jekkos/opensourcepos /bin/sh -c "cd /app; npm install" - - docker ps -a script: - - docker run -d -p 127.0.0.1:80:80 jekkos/opensourcepos /bin/sh -c "cd /app; grunt mochaWebdriver:test" + - docker run -i -p 127.0.0.1:80:80 jekkos/opensourcepos /bin/sh -c "cd /app; grunt mochaWebdriver:test" From 22a7231d8fb925be8d61b6d9680066b5a72300ce Mon Sep 17 00:00:00 2001 From: jekkos Date: Mon, 25 Jan 2016 19:16:13 +0100 Subject: [PATCH 2/7] Run docker container in background + launch tests once ready --- .travis.yml | 4 +++- Dockerfile | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b61dc8cc0..586044f17 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,6 +10,8 @@ services: before_install: - docker build -t jekkos/opensourcepos . + - docker run -d -p 127.0.0.1:80:80 jekkos/opensourcepos + - sleep 10 script: - - docker run -i -p 127.0.0.1:80:80 jekkos/opensourcepos /bin/sh -c "cd /app; grunt mochaWebdriver:test" + - docker exec -t -i $(docker ps | tail -n 1 | cut -d' ' -f1) /bin/sh -c "cd /app; grunt mochaWebdriver:test" diff --git a/Dockerfile b/Dockerfile index 2befc5538..adc2ea166 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,6 +20,7 @@ RUN npm install -g grunt-cli RUn ln -s /usr/local/bin/grunt /usr/bin/grunt RUN ln -fs /app/* /var/www/html +RUN ln -s /app /var/www/html/pos ADD ./docker/start_container.sh /start_container.sh RUN chmod 755 /start_container.sh EXPOSE 80 3306 From 0a159c803f24b89cb5ddecaaacb6d3e45fcfbc80 Mon Sep 17 00:00:00 2001 From: jekkos Date: Mon, 25 Jan 2016 21:14:48 +0100 Subject: [PATCH 3/7] Add testcase for creating new item Optimise CI setup --- .travis.yml | 2 +- Dockerfile | 1 - test/giftcard_numbering.js | 30 ++++++------------------------ test/login.js | 3 --- test/make_sale.js | 13 +++++++++++++ test/ospos.js | 33 +++++++++++++++++++++++++++++++++ travis-ci-apache | 21 --------------------- 7 files changed, 53 insertions(+), 50 deletions(-) delete mode 100644 test/login.js create mode 100644 test/make_sale.js create mode 100644 test/ospos.js delete mode 100644 travis-ci-apache diff --git a/.travis.yml b/.travis.yml index 586044f17..4ba69aeaf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,7 @@ services: before_install: - docker build -t jekkos/opensourcepos . - docker run -d -p 127.0.0.1:80:80 jekkos/opensourcepos - - sleep 10 + - sleep 4 script: - docker exec -t -i $(docker ps | tail -n 1 | cut -d' ' -f1) /bin/sh -c "cd /app; grunt mochaWebdriver:test" diff --git a/Dockerfile b/Dockerfile index adc2ea166..2befc5538 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,7 +20,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 ln -s /app /var/www/html/pos ADD ./docker/start_container.sh /start_container.sh RUN chmod 755 /start_container.sh EXPOSE 80 3306 diff --git a/test/giftcard_numbering.js b/test/giftcard_numbering.js index 40bb2caeb..8eb3e54fd 100644 --- a/test/giftcard_numbering.js +++ b/test/giftcard_numbering.js @@ -1,34 +1,16 @@ var assert = require("assert"); // node.js core module +var ospos = require("./ospos"); 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'"; - }; + this.timeout(25000); 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); - + return ospos.login(this.browser, done); }); - it.skip("issue #65: giftcard numbering should add properly", function() { - return this.browser.get(url("/index.php/giftcards")).waitForElementByCss(".big_button").click() - .waitForElementByName("value", 4000).type("100").elementById('giftcard_number').clear().type("10") + it("issue #65: giftcard numbering should add properly", function() { + 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) { assert.ok(value, "giftcard failed to be added properly!"); }).elementByCss(".big_button").click().waitForElementByName("value", 4000).type("100").elementById("submit").click() diff --git a/test/login.js b/test/login.js deleted file mode 100644 index 35c6961ce..000000000 --- a/test/login.js +++ /dev/null @@ -1,3 +0,0 @@ -exports.loginFirst = function() { - -} \ No newline at end of file diff --git a/test/make_sale.js b/test/make_sale.js new file mode 100644 index 000000000..b63620330 --- /dev/null +++ b/test/make_sale.js @@ -0,0 +1,13 @@ +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 diff --git a/test/ospos.js b/test/ospos.js new file mode 100644 index 000000000..5d9d023ba --- /dev/null +++ b/test/ospos.js @@ -0,0 +1,33 @@ +var assert = require('assert'); + +var ospos = function() { + + var server = "http://localhost"; + + return { + + url : function(suffix) { + 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); + + } + } +}; + +module.exports = ospos(); \ No newline at end of file diff --git a/travis-ci-apache b/travis-ci-apache deleted file mode 100644 index 4c93d795e..000000000 --- a/travis-ci-apache +++ /dev/null @@ -1,21 +0,0 @@ -Alias /pos %TRAVIS_BUILD_DIR% - - - DocumentRoot %TRAVIS_BUILD_DIR% - - - Options FollowSymLinks MultiViews ExecCGI - AllowOverride All - Order deny,allow - Allow from all - - - # Wire up Apache to use Travis CI's php-fpm. - - AddHandler php5-fcgi .php - Action php5-fcgi /php5-fcgi - Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi - FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -host 127.0.0.1:9000 -pass-header Authorization - - - From a3119d19936fd5fb644c871bea294c885b694f30 Mon Sep 17 00:00:00 2001 From: jekkos Date: Tue, 26 Jan 2016 08:44:48 +0100 Subject: [PATCH 4/7] Add integration test for creating new item --- test/giftcard_numbering.js | 7 ++++--- test/make_item.js | 17 +++++++++++++++++ test/make_sale.js | 13 ------------- 3 files changed, 21 insertions(+), 16 deletions(-) create mode 100644 test/make_item.js delete mode 100644 test/make_sale.js 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 From 8aab154a9f87c21bb5bc7f2ecba2aaac75979987 Mon Sep 17 00:00:00 2001 From: jekkos Date: Tue, 26 Jan 2016 16:27:06 +0100 Subject: [PATCH 5/7] Disable sudo for travis tests, omit nodejs version --- .travis.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4ba69aeaf..6158f70ac 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,7 @@ -sudo: required +sudo: false language: node_js -node_js: - - 0.10 - services: - docker From 847c4a67c9212e5951c6e4560a556919978d971d Mon Sep 17 00:00:00 2001 From: jekkos Date: Tue, 26 Jan 2016 20:27:07 +0100 Subject: [PATCH 6/7] Add integration test for making sale (#305) --- application/views/sales/register.php | 6 ++++-- test/giftcard_numbering.js | 3 +-- test/{make_item.js => make_sale.js} | 13 +++++++++++-- 3 files changed, 16 insertions(+), 6 deletions(-) rename test/{make_item.js => make_sale.js} (54%) diff --git a/application/views/sales/register.php b/application/views/sales/register.php index 170e567e4..34a5ff0ff 100644 --- a/application/views/sales/register.php +++ b/application/views/sales/register.php @@ -259,8 +259,9 @@ if (isset($success)) if(count($cart) > 0) { ?> + 'cancel_sale_form')); ?> +
- 'cancel_sale_form')); ?>
lang->line('sales_cancel_sale'); ?>
@@ -279,8 +280,9 @@ if (isset($success)) if(count($payments) > 0) { ?> + 'finish_sale_form')); ?> +
- 'finish_sale_form')); ?> 'comment', 'id'=>'comment', 'value'=>$comment, 'rows'=>'4', 'cols'=>'23'));?>
diff --git a/test/giftcard_numbering.js b/test/giftcard_numbering.js index cc8d95911..7b7390113 100644 --- a/test/giftcard_numbering.js +++ b/test/giftcard_numbering.js @@ -2,14 +2,13 @@ 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(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) { diff --git a/test/make_item.js b/test/make_sale.js similarity index 54% rename from test/make_item.js rename to test/make_sale.js index b80be2dab..70998e4fa 100644 --- a/test/make_item.js +++ b/test/make_sale.js @@ -1,9 +1,10 @@ var assert = require('assert'); var ospos = require('./ospos'); -describe("create item", function () { +describe("create item and make sale", function () { + this.timeout(25000); - it("should be able to add new item", function (done) { + it("should be able to add 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") @@ -14,4 +15,12 @@ describe("create item", function () { }).then(done, done); }); + it("should be able to make sale", function(done) { + return this.browser.get(ospos.url("/index.php/sales")).elementById("item", 3000).type("1\r\n") + .waitForElementByName("quantity", 5000).clear().type("2").elementByName("discount", 1000).type("10").elementByName("edit_item").click() + .elementById("add_payment_button", 2000).click().elementByCssSelector("tbody#payment_contents tr td:nth-child(3)", 5000).text().then(function(value) { + assert.equal(value, "$43.56", "discounted price " + value + " is not correct!!"); + }).then(done, done); + }); + }); \ No newline at end of file From 85c6da43465451da40615ef643c51765858f41c5 Mon Sep 17 00:00:00 2001 From: jekkos Date: Wed, 27 Jan 2016 20:11:21 +0100 Subject: [PATCH 7/7] Add integration test for making receiving (#305) Update docker scripts to work with data volumes (#284) --- Dockerfile | 1 + README.md | 10 +++++++-- docker/start_container.sh | 6 ++--- test/make_sale.js | 26 --------------------- test/make_sale_receiving.js | 45 +++++++++++++++++++++++++++++++++++++ 5 files changed, 57 insertions(+), 31 deletions(-) delete mode 100644 test/make_sale.js create mode 100644 test/make_sale_receiving.js diff --git a/Dockerfile b/Dockerfile index 2befc5538..89e010c03 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,6 +20,7 @@ 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/html/index.html ADD ./docker/start_container.sh /start_container.sh RUN chmod 755 /start_container.sh EXPOSE 80 3306 diff --git a/README.md b/README.md index 633be35c5..1c57198af 100644 --- a/README.md +++ b/README.md @@ -25,9 +25,15 @@ To build and run the image, issue following commands in a terminal with docker i docker build -t me/ospos https://github.com/jekkos/opensourcepos.git docker run -d -p 80:80 me/ospos -Docker will clone the latest master into the image and start a LAMP stack with the application configured. +Docker will clone the latest master into the image and start a LAMP stack with the application configured. If you like to persist your changes in this install, then you can use two docker data containers to store database and filesystem changes. In this case you will need following command (first time only) -A more extensive setup guide can be found at [this site](http://www.opensourceposguide.com/guide/gettingstarted/installation) + docker run -d -v /app --name="ospos" -v /var/lib/mysql --name="ospos-sql" -p 127.0.0.1:80:80 me/ospos + +After stopping the created container for the first time, this command will be replaced with + + docker run -d -v /app --volumes-from="ospos" -v /var/lib/mysql --volumes-from="ospos-sql" -p 127.0.0.1:80:80 me/ospos + +Both the data and mysql directories will be persisted in a separate docker container and can be mounted within any other container using the last command. A more extensive setup guide can be found at [this site](http://www.opensourceposguide.com/guide/gettingstarted/installation) If you like the project, and you are making money out of it on a daily basis, then consider to buy me a coffee so I can keep adding features. diff --git a/docker/start_container.sh b/docker/start_container.sh index 449edec29..0c13fd423 100644 --- a/docker/start_container.sh +++ b/docker/start_container.sh @@ -1,10 +1,10 @@ #!/bin/bash -if [ ! -f /mysql-configured ]; then +if [ ! -f /app/mysql-configured ]; then /usr/bin/mysqld_safe & sleep 10s MYSQL_PASSWORD=`pwgen -c -n -1 12` echo mysql root password: $MYSQL_PASSWORD - echo $MYSQL_PASSWORD > /mysql-root-pw.txt + echo $MYSQL_PASSWORD > /app/mysql-root-pw.txt [ -f /var/www/html/index.html ] && rm /var/www/html/index.html mysqladmin -u root password $MYSQL_PASSWORD cp /app/application/config/database.php.tmpl /app/application/config/database.php @@ -12,7 +12,7 @@ if [ ! -f /mysql-configured ]; then sed -i -e "s/\(password.*\?=.\).*\(.\)$/\1'${MYSQL_PASSWORD}'\2/g" /app/application/config/database.php sed -i -e "s/\(database.*\?=.\).*\(.\)$/\1'ospos'\2/g" /app/application/config/database.php mysql -e "CREATE DATABASE IF NOT EXISTS ospos; use ospos; source /app/database/tables.sql; source /app/database/constraints.sql;" -uroot -p${MYSQL_PASSWORD} - touch /mysql-configured + touch /app/mysql-configured killall mysqld sleep 10s fi diff --git a/test/make_sale.js b/test/make_sale.js deleted file mode 100644 index 70998e4fa..000000000 --- a/test/make_sale.js +++ /dev/null @@ -1,26 +0,0 @@ -var assert = require('assert'); -var ospos = require('./ospos'); - -describe("create item and make sale", function () { - this.timeout(25000); - - it("should be able to add 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); - }); - - it("should be able to make sale", function(done) { - return this.browser.get(ospos.url("/index.php/sales")).elementById("item", 3000).type("1\r\n") - .waitForElementByName("quantity", 5000).clear().type("2").elementByName("discount", 1000).type("10").elementByName("edit_item").click() - .elementById("add_payment_button", 2000).click().elementByCssSelector("tbody#payment_contents tr td:nth-child(3)", 5000).text().then(function(value) { - assert.equal(value, "$43.56", "discounted price " + value + " is not correct!!"); - }).then(done, done); - }); - -}); \ No newline at end of file diff --git a/test/make_sale_receiving.js b/test/make_sale_receiving.js new file mode 100644 index 000000000..1a3c4471b --- /dev/null +++ b/test/make_sale_receiving.js @@ -0,0 +1,45 @@ +var assert = require('assert'); +var ospos = require('./ospos'); + +describe("create item and make sale", function () { + this.timeout(25000); + + it("should be able to add 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); + }); + + it("should be able to make sale", function(done) { + return this.browser.get(ospos.url("/index.php/sales")) + .elementById("item", 3000).type("1\r\n") + .waitForElementByName("quantity", 5000).clear().type("2").elementByName("discount", 1000).type("10").elementByName("edit_item").click() + .elementById("add_payment_button", 2000).click().elementByCssSelector("tbody#payment_contents tr td:last-child", 5000).text().then(function(value) { + assert.equal(value, "$43.56", "price " + value + " in sale register is not correct!!"); + }).elementById("finish_sale_button", 3000).submit().elementByCssSelector("#receipt_items tbody tr:nth-child(7) td:last-child", 5000).text().then(function(value) { + assert.equal(value, "$43.56", "price " + value + " on sale receipt is not correct!!"); + }).elementByCssSelector("#receipt_items tbody tr:nth-child(9) td:last-child div.total-value", 5000).text().then(function(value) { + assert.equal(value, "-$43.56", "payment amount " + value + " on sale receipt is not correct!!") + }).then(done, done); + }); + + + it("should be able to make receiving", function(done) { + return this.browser.get(ospos.url("/index.php/receivings")) + .elementById("item", 3000).type("1\r\n") + .waitForElementByName("quantity", 3000).clear().type("2").elementByName("edit_item").click() + .elementByCssSelector("td:nth-last-child(2)").text().then(function(value) { + assert.equal(value, "$20.00", "price " + value + " in receiving register is not correct!!"); + }).elementById("finish_receiving_button").submit().elementByCssSelector("#receipt_items tbody tr:nth-last-child(2) td:nth-child(2) div.total-value").text().then(function(value) { + assert.equal(value, "$20.00", "price " + value + " on receiving receipt is not correct!!"); + }) + .then(done, done); + }); + + +}); \ No newline at end of file