Files
opensourcepos/tests/receiving_quantity.js
BudsieBuds e83c23cf0c Improve code style and PSR-12 compliance (#4204)
* Improve code style and PSR-12 compliance
- refactored code formatting to adhere to PSR-12 guidelines
- standardized coding conventions across the codebase
- added missing framework files and reverted markup changes
- reformatted arrays for enhanced readability
- updated language files for consistent styling and clarity
- minor miscellaneous improvements
2025-05-02 19:37:06 +02:00

33 lines
1.4 KiB
JavaScript

var assert = require('assert');
var ospos = require('./ospos');
describe("test receiving quantity", function () {
var def_timeout = 10000;
var item = {
name: "recvQty",
category: "aCategory",
cost_price: 10,
unit_price: 20,
receiving_quantity: 2
};
it("should be able to create item with receiving quantity", function (done) {
return ospos.create_item(this.browser, item).then(done, done);
});
it("should be able to receive quantities with multiplier", function (done) {
this.browser.get(ospos.url('/index.php/receivings')).elementById("item").clear().type(item.name)
.elementByCssSelector(".ui-autocomplete .ui-menu-item", def_timeout).click()
.elementByName("quantity")
.elementByCssSelector("#cart_contents tr td:nth-child(5)").text().then(function (value) {
assert(value, "x " + item.receiving_quantity, "receiving quantity " + item.receiving_quantity + " is not displayed correctly in receivings module!");
}).elementById("finish_receiving_button", def_timeout).submit()
.elementByCssSelector("#receipt_items tr:nth-child(2) td:nth-last-child(2)", def_timeout).text().then(function (value) {
assert(value, "1 x " + item.receiving_quantity, "receiving quantity " + item.receiving_quantity + " is not displayed correctly on receipt!!");
}).then(done, done);
});
});