From 274d1475c991aac796ac1af597c4ec74f4d10d46 Mon Sep 17 00:00:00 2001 From: Bernat Exposito Date: Wed, 28 Feb 2018 15:40:52 +0100 Subject: [PATCH] resolve bugs in e2e test in windows and new module invoice-out --- e2e/helpers/selectors.js | 2 +- e2e/paths/item-module/01_item_summary.spec.js | 2 +- .../08_item_create_and_clone.spec.js | 5 +- .../client/common/models/invoice-out.json | 55 +++++++++++++++++++ services/client/server/model-config.json | 6 ++ 5 files changed, 66 insertions(+), 4 deletions(-) create mode 100644 services/client/common/models/invoice-out.json diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index ee90c48d32..94a730df47 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -245,7 +245,7 @@ export default { }, itemSummary: { basicData: `${components.vnItemSummary} > vn-horizontal:nth-child(1) > vn-one:nth-child(2) > vn-vertical > p:nth-child(2)`, - tags: `${components.vnItemSummary} > vn-horizontal:nth-child(1) > vn-one:nth-child(3) > vn-vertical > p:nth-child(2)`, + tags: `${components.vnItemSummary} > vn-horizontal:nth-child(1) > vn-one:nth-child(3) > vn-vertical > p`, niche: `${components.vnItemSummary} > vn-horizontal:nth-child(2) > vn-one:nth-child(1) > vn-vertical > p:nth-child(2)`, botanical: `${components.vnItemSummary} > vn-horizontal:nth-child(2) > vn-one:nth-child(2) > vn-vertical > p`, barcode: `${components.vnItemSummary} > vn-horizontal:nth-child(2) > vn-one:nth-child(3) > vn-vertical > p` diff --git a/e2e/paths/item-module/01_item_summary.spec.js b/e2e/paths/item-module/01_item_summary.spec.js index 3e95f468fd..2b87ab0c1a 100644 --- a/e2e/paths/item-module/01_item_summary.spec.js +++ b/e2e/paths/item-module/01_item_summary.spec.js @@ -51,7 +51,7 @@ describe('Item summary path', () => { it(`should check the item summary preview shows fields from tags`, () => { return nightmare - .waitForTextInElement(selectors.itemSummary.tags, 'Color: Yellow') + .wait(200) .getInnerText(selectors.itemSummary.tags) .then(result => { expect(result).toContain('Color: Yellow'); diff --git a/e2e/paths/item-module/08_item_create_and_clone.spec.js b/e2e/paths/item-module/08_item_create_and_clone.spec.js index 0275a3f64a..66c3d79b01 100644 --- a/e2e/paths/item-module/08_item_create_and_clone.spec.js +++ b/e2e/paths/item-module/08_item_create_and_clone.spec.js @@ -85,13 +85,14 @@ describe('Item', () => { }); describe('clone path', () => { - it('should access to the items index by clicking the items button', () => { + it('should return to the items index by clicking the return to items button', () => { return nightmare .click(selectors.itemBasicData.goToItemIndexButton) .wait(selectors.itemsIndex.createItemButton) + .waitForURL('#!/item/list') .parsedUrl() .then(url => { - expect(url.hash).toEqual('#!/item/list'); + expect(url.hash).toContain('#!/item/list'); }); }); diff --git a/services/client/common/models/invoice-out.json b/services/client/common/models/invoice-out.json new file mode 100644 index 0000000000..704901b086 --- /dev/null +++ b/services/client/common/models/invoice-out.json @@ -0,0 +1,55 @@ +{ + "name": "InvoiceOut", + "base": "VnModel", + "options": { + "mysql": { + "table": "invoiceOut" + } + }, + "properties": { + "id": { + "id": true, + "type": "Number", + "description": "Identifier" + }, + "ref": { + "id": true, + "type": "String", + "required": true + }, + "serial": { + "type": "String" + }, + "issued": { + "type": "date" + }, + "amount": { + "type": "Number" + }, + "created": { + "type": "date" + }, + "dued": { + "type": "date" + }, + "booked": { + "type": "date" + }, + "pdf": { + "type": "Number" + } + }, + "relations": { + "client": { + "type": "belongsTo", + "model": "Client", + "foreignKey": "clientFk" + }, + "company": { + "type": "belongsTo", + "model": "Company", + "foreignKey": "companyFk", + "required": true + } + } + } \ No newline at end of file diff --git a/services/client/server/model-config.json b/services/client/server/model-config.json index 69fee066ab..95c2e32534 100644 --- a/services/client/server/model-config.json +++ b/services/client/server/model-config.json @@ -25,5 +25,11 @@ }, "ObservationType": { "dataSource": "vn" + }, + "Recovery": { + "dataSource": "vn" + }, + "InvoiceOut": { + "dataSource": "vn" } }