mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-10-22 00:04:37 -04:00
Add testcase for creating new item
Optimise CI setup
This commit is contained in:
1 parent
22a7231d8f
commit
0a159c803f
7 files changed
+53
-50
No files matched your search
@@ -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()
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
exports.loginFirst = function() {
|
||||
|
||||
}
|
||||
@@ -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();
|
||||
});
|
||||
|
||||
});
|
||||
@@ -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();
|
||||
Reference in new issue
Block a user