From 59642ab3ca579cc7bb90ea349ebe6cce1dce5a2a Mon Sep 17 00:00:00 2001 From: carlossa Date: Mon, 12 Jun 2023 15:44:22 +0200 Subject: [PATCH 1/8] refs #5325 defaultSearch --- modules/claim/front/action/index.js | 1 + modules/claim/front/index/index.js | 1 + modules/client/front/defaulter/index.js | 1 + modules/client/front/extended-list/index.js | 1 + modules/client/front/notification/index.js | 1 + modules/entry/front/latest-buys/index.js | 1 + modules/invoiceOut/front/negative-bases/index.js | 4 +++- modules/item/front/index/index.js | 1 + modules/item/front/item-shelving/index.js | 1 + modules/monitor/front/index/clients/index.js | 1 + modules/monitor/front/index/tickets/index.js | 1 + modules/route/front/agency-term/index/index.js | 1 + modules/ticket/front/advance/index.js | 1 + modules/ticket/front/expedition/index.js | 1 + modules/ticket/front/future/index.js | 1 + modules/ticket/front/weekly/index.js | 1 + 16 files changed, 18 insertions(+), 1 deletion(-) diff --git a/modules/claim/front/action/index.js b/modules/claim/front/action/index.js index 10b629f27..6b4879a85 100644 --- a/modules/claim/front/action/index.js +++ b/modules/claim/front/action/index.js @@ -26,6 +26,7 @@ export default class Controller extends Section { activeButtons: { search: true }, + defaultSearch: true, columns: [ { field: 'claimDestinationFk', diff --git a/modules/claim/front/index/index.js b/modules/claim/front/index/index.js index e3fdabf79..8e948f426 100644 --- a/modules/claim/front/index/index.js +++ b/modules/claim/front/index/index.js @@ -9,6 +9,7 @@ class Controller extends Section { activeButtons: { search: true }, + defaultSearch: true, columns: [ { field: 'clientName', diff --git a/modules/client/front/defaulter/index.js b/modules/client/front/defaulter/index.js index 95c7622f9..1244191f1 100644 --- a/modules/client/front/defaulter/index.js +++ b/modules/client/front/defaulter/index.js @@ -12,6 +12,7 @@ export default class Controller extends Section { activeButtons: { search: true }, + defaultSearch: true, columns: [ { field: 'clientFk', diff --git a/modules/client/front/extended-list/index.js b/modules/client/front/extended-list/index.js index 8eed48d01..2cb7a6d58 100644 --- a/modules/client/front/extended-list/index.js +++ b/modules/client/front/extended-list/index.js @@ -11,6 +11,7 @@ class Controller extends Section { search: true, shownColumns: true, }, + defaultSearch: true, columns: [ { field: 'socialName', diff --git a/modules/client/front/notification/index.js b/modules/client/front/notification/index.js index faa062b25..ada543715 100644 --- a/modules/client/front/notification/index.js +++ b/modules/client/front/notification/index.js @@ -9,6 +9,7 @@ export default class Controller extends Section { activeButtons: { search: true }, + defaultSearch: true, columns: [ { field: 'socialName', diff --git a/modules/entry/front/latest-buys/index.js b/modules/entry/front/latest-buys/index.js index d9065193e..1a9b3627b 100644 --- a/modules/entry/front/latest-buys/index.js +++ b/modules/entry/front/latest-buys/index.js @@ -14,6 +14,7 @@ export default class Controller extends Section { search: true, shownColumns: true, }, + defaultSearch: true, columns: [ { field: 'code', diff --git a/modules/invoiceOut/front/negative-bases/index.js b/modules/invoiceOut/front/negative-bases/index.js index 1a838507c..b70a2f7be 100644 --- a/modules/invoiceOut/front/negative-bases/index.js +++ b/modules/invoiceOut/front/negative-bases/index.js @@ -19,7 +19,9 @@ export default class Controller extends Section { this.smartTableOptions = { activeButtons: { search: true, - }, columns: [ + }, + defaultSearch: true, + columns: [ { field: 'isActive', searchable: false diff --git a/modules/item/front/index/index.js b/modules/item/front/index/index.js index 10bd4bbb7..f341f6454 100644 --- a/modules/item/front/index/index.js +++ b/modules/item/front/index/index.js @@ -11,6 +11,7 @@ class Controller extends Section { search: true, shownColumns: true, }, + defaultSearch: true, columns: [ { field: 'category', diff --git a/modules/item/front/item-shelving/index.js b/modules/item/front/item-shelving/index.js index b8584039b..8e5df459d 100644 --- a/modules/item/front/item-shelving/index.js +++ b/modules/item/front/item-shelving/index.js @@ -9,6 +9,7 @@ export default class Controller extends Section { activeButtons: { search: true }, + defaultSearch: true, columns: [ { field: 'parking', diff --git a/modules/monitor/front/index/clients/index.js b/modules/monitor/front/index/clients/index.js index ac3ce9140..9faf2ed53 100644 --- a/modules/monitor/front/index/clients/index.js +++ b/modules/monitor/front/index/clients/index.js @@ -20,6 +20,7 @@ export default class Controller extends Section { activeButtons: { search: true }, + defaultSearch: true, columns: [ { field: 'clientFk', diff --git a/modules/monitor/front/index/tickets/index.js b/modules/monitor/front/index/tickets/index.js index 2f2dead05..92097833b 100644 --- a/modules/monitor/front/index/tickets/index.js +++ b/modules/monitor/front/index/tickets/index.js @@ -12,6 +12,7 @@ export default class Controller extends Section { search: true, shownColumns: true, }, + defaultSearch: true, columns: [ { field: 'totalProblems', diff --git a/modules/route/front/agency-term/index/index.js b/modules/route/front/agency-term/index/index.js index 6c3bafc9a..6277fb9a1 100644 --- a/modules/route/front/agency-term/index/index.js +++ b/modules/route/front/agency-term/index/index.js @@ -9,6 +9,7 @@ class Controller extends Section { activeButtons: { search: true }, + defaultSearch: true, columns: [ { field: 'agencyModeFk', diff --git a/modules/ticket/front/advance/index.js b/modules/ticket/front/advance/index.js index 0cec41227..0cd1b0981 100644 --- a/modules/ticket/front/advance/index.js +++ b/modules/ticket/front/advance/index.js @@ -11,6 +11,7 @@ export default class Controller extends Section { activeButtons: { search: true, }, + defaultSearch: true, columns: [ { field: 'state', diff --git a/modules/ticket/front/expedition/index.js b/modules/ticket/front/expedition/index.js index b8046be52..1e30ce447 100644 --- a/modules/ticket/front/expedition/index.js +++ b/modules/ticket/front/expedition/index.js @@ -11,6 +11,7 @@ class Controller extends Section { search: true, shownColumns: true, }, + defaultSearch: true, columns: [ { field: 'packageItemName', diff --git a/modules/ticket/front/future/index.js b/modules/ticket/front/future/index.js index 66d626993..846c3883f 100644 --- a/modules/ticket/front/future/index.js +++ b/modules/ticket/front/future/index.js @@ -10,6 +10,7 @@ export default class Controller extends Section { activeButtons: { search: true, }, + defaultSearch: true, columns: [{ field: 'totalProblems', searchable: false, diff --git a/modules/ticket/front/weekly/index.js b/modules/ticket/front/weekly/index.js index a10ff7184..d0a333158 100644 --- a/modules/ticket/front/weekly/index.js +++ b/modules/ticket/front/weekly/index.js @@ -22,6 +22,7 @@ export default class Controller extends Section { search: true, shownColumns: true, }, + defaultSearch: true, columns: [ { field: 'ticketFk', From 7127c5a3a820add9c2168975ae1c82aa615cc0ce Mon Sep 17 00:00:00 2001 From: carlossa Date: Mon, 12 Jun 2023 17:37:25 +0200 Subject: [PATCH 2/8] refs #5325 e2e 1 smart Table --- e2e/helpers/selectors.js | 8 ++++---- e2e/paths/02-client/21_defaulter.spec.js | 2 +- e2e/paths/04-item/01_summary.spec.js | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index 039f6ee8f..19ea23d73 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -311,9 +311,9 @@ export default { }, clientDefaulter: { anyClient: 'vn-client-defaulter tbody > tr', - firstClientName: 'vn-client-defaulter tbody > tr:nth-child(1) > td:nth-child(2) > span', - firstSalesPersonName: 'vn-client-defaulter tbody > tr:nth-child(1) > td:nth-child(3) > span', - firstObservation: 'vn-client-defaulter tbody > tr:nth-child(1) > td:nth-child(8) > vn-textarea[ng-model="defaulter.observation"]', + firstClientName: 'vn-client-defaulter tbody > tr:nth-child(2) > td:nth-child(2) > span', + firstSalesPersonName: 'vn-client-defaulter tbody > tr:nth-child(2) > td:nth-child(3) > span', + firstObservation: 'vn-client-defaulter tbody > tr:nth-child(2) > td:nth-child(8) > vn-textarea[ng-model="defaulter.observation"]', allDefaulterCheckbox: 'vn-client-defaulter thead vn-multi-check', addObservationButton: 'vn-client-defaulter vn-button[icon="icon-notes"]', observation: '.vn-dialog.shown vn-textarea[ng-model="$ctrl.defaulter.observation"]', @@ -336,7 +336,7 @@ export default { createItemButton: `vn-float-button`, firstSearchResult: 'vn-item-index tbody tr:nth-child(1)', searchResult: 'vn-item-index tbody tr:not(.empty-rows)', - firstResultPreviewButton: 'vn-item-index tbody > :nth-child(1) .buttons > [icon="preview"]', + firstResultPreviewButton: 'vn-item-index tbody > :nth-child(2) .buttons > [icon="preview"]', searchResultCloneButton: 'vn-item-index .buttons > [icon="icon-clone"]', acceptClonationAlertButton: '.vn-confirm.shown [response="accept"]', closeItemSummaryPreview: '.vn-popup.shown', diff --git a/e2e/paths/02-client/21_defaulter.spec.js b/e2e/paths/02-client/21_defaulter.spec.js index 97e62abef..2bb3d6254 100644 --- a/e2e/paths/02-client/21_defaulter.spec.js +++ b/e2e/paths/02-client/21_defaulter.spec.js @@ -19,7 +19,7 @@ describe('Client defaulter path', () => { it('should count the amount of clients in the turns section', async() => { const result = await page.countElement(selectors.clientDefaulter.anyClient); - expect(result).toEqual(5); + expect(result).toEqual(6); }); it('should check contain expected client', async() => { diff --git a/e2e/paths/04-item/01_summary.spec.js b/e2e/paths/04-item/01_summary.spec.js index e24fa6a9f..621dd9cd8 100644 --- a/e2e/paths/04-item/01_summary.spec.js +++ b/e2e/paths/04-item/01_summary.spec.js @@ -1,7 +1,7 @@ import selectors from '../../helpers/selectors.js'; import getBrowser from '../../helpers/puppeteer'; -describe('Item summary path', () => { +fdescribe('Item summary path', () => { let browser; let page; beforeAll(async() => { @@ -22,7 +22,7 @@ describe('Item summary path', () => { await page.waitToClick(selectors.itemsIndex.firstResultPreviewButton); const isVisible = await page.isVisible(selectors.itemSummary.basicData); - expect(resultsCount).toBe(3); + expect(resultsCount).toBe(4); expect(isVisible).toBeTruthy(); }); From b7c8b03a650e3d6dca07e1ec27e924be58cd08dc Mon Sep 17 00:00:00 2001 From: carlossa Date: Mon, 12 Jun 2023 19:51:16 +0200 Subject: [PATCH 3/8] refs #5325 e2e 2 --- e2e/helpers/selectors.js | 32 +++++++++---------- e2e/paths/04-item/01_summary.spec.js | 6 ++-- e2e/paths/04-item/10_item_log.spec.js | 2 +- .../05-ticket/01-sale/02_edit_sale.spec.js | 4 +-- .../05-ticket/02_expeditions_and_log.spec.js | 2 +- e2e/paths/05-ticket/09_weekly.spec.js | 6 ++-- e2e/paths/05-ticket/20_moveExpedition.spec.js | 4 +-- e2e/paths/05-ticket/21_future.spec.js | 2 +- 8 files changed, 29 insertions(+), 29 deletions(-) diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index 19ea23d73..3d5bcddb5 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -334,7 +334,7 @@ export default { }, itemsIndex: { createItemButton: `vn-float-button`, - firstSearchResult: 'vn-item-index tbody tr:nth-child(1)', + firstSearchResult: 'vn-item-index tbody tr:nth-child(2)', searchResult: 'vn-item-index tbody tr:not(.empty-rows)', firstResultPreviewButton: 'vn-item-index tbody > :nth-child(2) .buttons > [icon="preview"]', searchResultCloneButton: 'vn-item-index .buttons > [icon="icon-clone"]', @@ -342,7 +342,7 @@ export default { closeItemSummaryPreview: '.vn-popup.shown', shownColumns: 'vn-item-index vn-button[id="shownColumns"]', shownColumnsList: '.vn-popover.shown .content', - firstItemImage: 'vn-item-index tbody > tr:nth-child(1) > td:nth-child(1) > img', + firstItemImage: 'vn-item-index tbody > tr:nth-child(2) > td:nth-child(1) > img', firstItemImageTd: 'vn-item-index smart-table tr:nth-child(1) td:nth-child(1)', firstItemId: 'vn-item-index tbody > tr:nth-child(1) > td:nth-child(2)', idCheckbox: '.vn-popover.shown vn-horizontal:nth-child(3) > vn-check[label="Identifier"]', @@ -526,8 +526,8 @@ export default { fourthWeeklyTicket: 'vn-ticket-weekly-index vn-card smart-table slot-table tr:nth-child(4)', fiveWeeklyTicket: 'vn-ticket-weekly-index vn-card smart-table slot-table tr:nth-child(5)', weeklyTicket: 'vn-ticket-weekly-index vn-card smart-table slot-table table tbody tr', - firstWeeklyTicketDeleteIcon: 'vn-ticket-weekly-index vn-card smart-table slot-table tr:nth-child(1) vn-icon-button[icon="delete"]', - firstWeeklyTicketAgency: 'vn-ticket-weekly-index vn-card smart-table slot-table tr:nth-child(1) [ng-model="weekly.agencyModeFk"]', + firstWeeklyTicketDeleteIcon: 'vn-ticket-weekly-index vn-card smart-table slot-table tr:nth-child(2) vn-icon-button[icon="delete"]', + firstWeeklyTicketAgency: 'vn-ticket-weekly-index vn-card smart-table slot-table tr:nth-child(2) [ng-model="weekly.agencyModeFk"]', acceptDeleteTurn: '.vn-confirm.shown button[response="accept"]' }, createTicketView: { @@ -572,8 +572,8 @@ export default { submitNotesButton: 'button[type=submit]' }, ticketExpedition: { - firstSaleCheckbox: 'vn-ticket-expedition tr:nth-child(1) vn-check[ng-model="expedition.checked"]', - thirdSaleCheckbox: 'vn-ticket-expedition tr:nth-child(3) vn-check[ng-model="expedition.checked"]', + firstSaleCheckbox: 'vn-ticket-expedition tr:nth-child(2) vn-check[ng-model="expedition.checked"]', + thirdSaleCheckbox: 'vn-ticket-expedition tr:nth-child(4) vn-check[ng-model="expedition.checked"]', deleteExpeditionButton: 'vn-ticket-expedition slot-actions > vn-button[icon="delete"]', moveExpeditionButton: 'vn-ticket-expedition slot-actions > vn-button[icon="keyboard_arrow_down"]', moreMenuWithoutRoute: 'vn-item[name="withoutRoute"]', @@ -606,16 +606,16 @@ export default { firstSaleThumbnailImage: 'vn-ticket-sale:nth-child(1) vn-tr:nth-child(1) vn-td:nth-child(3) > img', firstSaleZoomedImage: 'body > div > div > img', firstSaleQuantity: 'vn-ticket-sale [ng-model="sale.quantity"]', - firstSaleQuantityCell: 'vn-ticket-sale vn-tr:nth-child(1) > vn-td-editable:nth-child(7)', + firstSaleQuantityCell: 'vn-ticket-sale vn-tr:nth-child(2) > vn-td-editable:nth-child(7)', firstSalePrice: 'vn-ticket-sale vn-table vn-tr:nth-child(1) > vn-td:nth-child(9) > span', firstSalePriceInput: '.vn-popover.shown input[ng-model="$ctrl.field"]', firstSaleDiscount: 'vn-ticket-sale vn-table vn-tr:nth-child(1) > vn-td:nth-child(10) > span', firstSaleDiscountInput: '.vn-popover.shown [ng-model="$ctrl.field"]', saveSaleDiscountButton: '.vn-popover.shown vn-button[label="Save"]', - firstSaleImport: 'vn-ticket-sale:nth-child(1) vn-td:nth-child(11)', - firstSaleReservedIcon: 'vn-ticket-sale vn-tr:nth-child(1) > vn-td:nth-child(2) > vn-icon:nth-child(3)', + firstSaleImport: 'vn-ticket-sale:nth-child(3) vn-td:nth-child(11)', + firstSaleReservedIcon: 'vn-ticket-sale vn-tr:nth-child(2) > vn-td:nth-child(2) > vn-icon:nth-child(3)', firstSaleColour: 'vn-ticket-sale vn-tr:nth-child(1) vn-fetched-tags section', - firstSaleCheckbox: 'vn-ticket-sale vn-tr:nth-child(1) vn-check[ng-model="sale.checked"]', + firstSaleCheckbox: 'vn-ticket-sale vn-tr:nth-child(2) vn-check[ng-model="sale.checked"]', secondSaleText: 'vn-table div > vn-tbody > vn-tr:nth-child(2)', secondSaleId: 'vn-ticket-sale:nth-child(2) vn-td-editable:nth-child(4) text > span', secondSaleIdAutocomplete: 'vn-ticket-sale vn-tr:nth-child(2) vn-autocomplete[ng-model="sale.itemFk"]', @@ -625,9 +625,9 @@ export default { secondSaleConceptInput: 'vn-ticket-sale vn-tbody > :nth-child(2) > vn-td-editable.ng-isolate-scope.selected vn-textfield', totalImport: 'vn-ticket-sale vn-one.taxes > p:nth-child(3) > strong', selectAllSalesCheckbox: 'vn-ticket-sale vn-thead vn-check', - secondSaleCheckbox: 'vn-ticket-sale vn-tr:nth-child(2) vn-check[ng-model="sale.checked"]', - thirdSaleCheckbox: 'vn-ticket-sale vn-tr:nth-child(3) vn-check[ng-model="sale.checked"]', - fourthSaleCheckbox: 'vn-ticket-sale vn-tr:nth-child(4) vn-check[ng-model="sale.checked"]', + secondSaleCheckbox: 'vn-ticket-sale vn-tr:nth-child(3) vn-check[ng-model="sale.checked"]', + thirdSaleCheckbox: 'vn-ticket-sale vn-tr:nth-child(4) vn-check[ng-model="sale.checked"]', + fourthSaleCheckbox: 'vn-ticket-sale vn-tr:nth-child(5) vn-check[ng-model="sale.checked"]', deleteSaleButton: 'vn-ticket-sale vn-tool-bar > vn-button[icon="delete"]', transferSaleButton: 'vn-ticket-sale vn-tool-bar > vn-button[icon="call_split"]', moveToTicketInput: 'form vn-input-number[ng-model="$ctrl.transfer.ticketId"] input', @@ -712,7 +712,7 @@ export default { problems: 'vn-check[label="With problems"]', tableButtonSearch: 'vn-button[vn-tooltip="Search"]', moveButton: 'vn-button[vn-tooltip="Future tickets"]', - firstCheck: 'tbody > tr:nth-child(1) > td > vn-check', + firstCheck: 'tbody > tr:nth-child(2) > td > vn-check', multiCheck: 'vn-multi-check', tableId: 'vn-textfield[name="id"]', tableFutureId: 'vn-textfield[name="futureId"]', @@ -736,7 +736,7 @@ export default { tableButtonSearch: 'vn-button[vn-tooltip="Search"]', moveButton: 'vn-button[vn-tooltip="Advance tickets"]', acceptButton: '.vn-confirm.shown button[response="accept"]', - firstCheck: 'tbody > tr:nth-child(1) > td > vn-check', + firstCheck: 'tbody > tr:nth-child(2) > td > vn-check', tableId: 'vn-textfield[name="id"]', tableFutureId: 'vn-textfield[name="futureId"]', tableLiters: 'vn-textfield[name="liters"]', @@ -810,7 +810,7 @@ export default { claimAction: { importClaimButton: 'vn-claim-action vn-button[label="Import claim"]', anyLine: 'vn-claim-action vn-tbody > vn-tr', - firstDeleteLine: 'vn-claim-action tr:nth-child(1) vn-icon-button[icon="delete"]', + firstDeleteLine: 'vn-claim-action tr:nth-child(2) vn-icon-button[icon="delete"]', isPaidWithManaCheckbox: 'vn-claim-action vn-check[ng-model="$ctrl.claim.isChargedToMana"]' }, ordersIndex: { diff --git a/e2e/paths/04-item/01_summary.spec.js b/e2e/paths/04-item/01_summary.spec.js index 621dd9cd8..e09ecb778 100644 --- a/e2e/paths/04-item/01_summary.spec.js +++ b/e2e/paths/04-item/01_summary.spec.js @@ -1,7 +1,7 @@ import selectors from '../../helpers/selectors.js'; import getBrowser from '../../helpers/puppeteer'; -fdescribe('Item summary path', () => { +describe('Item summary path', () => { let browser; let page; beforeAll(async() => { @@ -18,7 +18,7 @@ fdescribe('Item summary path', () => { await page.doSearch('Ranged weapon'); const resultsCount = await page.countElement(selectors.itemsIndex.searchResult); - await page.waitForTextInElement(selectors.itemsIndex.searchResult, 'Ranged weapon'); + await page.waitForTextInElement(selectors.itemsIndex.firstSearchResult, 'Ranged weapon'); await page.waitToClick(selectors.itemsIndex.firstResultPreviewButton); const isVisible = await page.isVisible(selectors.itemSummary.basicData); @@ -66,7 +66,7 @@ fdescribe('Item summary path', () => { await page.waitToClick(selectors.itemsIndex.firstResultPreviewButton); await page.waitForSelector(selectors.itemSummary.basicData, {visible: true}); - expect(resultsCount).toBe(2); + expect(resultsCount).toBe(3); }); it(`should now check the item summary preview shows fields from basic data`, async() => { diff --git a/e2e/paths/04-item/10_item_log.spec.js b/e2e/paths/04-item/10_item_log.spec.js index dc467044d..c88fbd337 100644 --- a/e2e/paths/04-item/10_item_log.spec.js +++ b/e2e/paths/04-item/10_item_log.spec.js @@ -18,7 +18,7 @@ describe('Item log path', () => { await page.doSearch('Knowledge artifact'); const nResults = await page.countElement(selectors.itemsIndex.searchResult); - expect(nResults).toEqual(0); + expect(nResults).toEqual(1); }); it('should access to the create item view by clicking the create floating button', async() => { diff --git a/e2e/paths/05-ticket/01-sale/02_edit_sale.spec.js b/e2e/paths/05-ticket/01-sale/02_edit_sale.spec.js index 6264073f6..a494a8848 100644 --- a/e2e/paths/05-ticket/01-sale/02_edit_sale.spec.js +++ b/e2e/paths/05-ticket/01-sale/02_edit_sale.spec.js @@ -365,7 +365,7 @@ describe('Ticket Edit sale path', () => { }); it('should confirm the original ticket received the line', async() => { - const expectedLines = 4; + const expectedLines = 3; await page.waitForNumberOfElements(selectors.ticketSales.saleLine, expectedLines); const result = await page.countElement(selectors.ticketSales.saleLine); @@ -402,7 +402,7 @@ describe('Ticket Edit sale path', () => { }); it('should confirm the new ticket received the line', async() => { - const expectedLines = 1; + const expectedLines = 3; const result = await page.countElement(selectors.ticketSales.saleLine); expect(result).toEqual(expectedLines); diff --git a/e2e/paths/05-ticket/02_expeditions_and_log.spec.js b/e2e/paths/05-ticket/02_expeditions_and_log.spec.js index edccd5561..b97576940 100644 --- a/e2e/paths/05-ticket/02_expeditions_and_log.spec.js +++ b/e2e/paths/05-ticket/02_expeditions_and_log.spec.js @@ -27,6 +27,6 @@ describe('Ticket expeditions and log path', () => { const result = await page .countElement(selectors.ticketExpedition.expeditionRow); - expect(result).toEqual(3); + expect(result).toEqual(4); }); }); diff --git a/e2e/paths/05-ticket/09_weekly.spec.js b/e2e/paths/05-ticket/09_weekly.spec.js index 0ba57aa9d..a9cce2ead 100644 --- a/e2e/paths/05-ticket/09_weekly.spec.js +++ b/e2e/paths/05-ticket/09_weekly.spec.js @@ -19,7 +19,7 @@ describe('Ticket descriptor path', () => { it('should count the amount of tickets in the turns section', async() => { const result = await page.countElement(selectors.ticketsIndex.weeklyTicket); - expect(result).toEqual(6); + expect(result).toEqual(7); }); it('should go back to the ticket index then search and access a ticket summary', async() => { @@ -89,7 +89,7 @@ describe('Ticket descriptor path', () => { await page.doSearch('11'); const nResults = await page.countElement(selectors.ticketsIndex.searchWeeklyResult); - expect(nResults).toEqual(1); + expect(nResults).toEqual(2); }); it('should delete the weekly ticket 11', async() => { @@ -104,7 +104,7 @@ describe('Ticket descriptor path', () => { await page.doSearch(); const nResults = await page.countElement(selectors.ticketsIndex.searchWeeklyResult); - expect(nResults).toEqual(6); + expect(nResults).toEqual(7); }); it('should update the agency then remove it afterwards', async() => { diff --git a/e2e/paths/05-ticket/20_moveExpedition.spec.js b/e2e/paths/05-ticket/20_moveExpedition.spec.js index cf1c5ded3..ae23c9c99 100644 --- a/e2e/paths/05-ticket/20_moveExpedition.spec.js +++ b/e2e/paths/05-ticket/20_moveExpedition.spec.js @@ -29,7 +29,7 @@ describe('Ticket expeditions', () => { const result = await page .countElement(selectors.ticketExpedition.expeditionRow); - expect(result).toEqual(1); + expect(result).toEqual(2); }); it(`should move one expedition to new ticket with route`, async() => { @@ -45,6 +45,6 @@ describe('Ticket expeditions', () => { const result = await page .countElement(selectors.ticketExpedition.expeditionRow); - expect(result).toEqual(1); + expect(result).toEqual(2); }); }); diff --git a/e2e/paths/05-ticket/21_future.spec.js b/e2e/paths/05-ticket/21_future.spec.js index c854dcbaf..7b7d478f7 100644 --- a/e2e/paths/05-ticket/21_future.spec.js +++ b/e2e/paths/05-ticket/21_future.spec.js @@ -87,7 +87,7 @@ describe('Ticket Future path', () => { await page.clearInput(selectors.ticketFuture.futureState); await page.waitToClick(selectors.ticketFuture.submit); - await page.waitForNumberOfElements(selectors.ticketFuture.searchResult, 4); + await page.waitForNumberOfElements(selectors.ticketFuture.searchResult, 5); await page.waitToClick(selectors.ticketFuture.multiCheck); await page.waitToClick(selectors.ticketFuture.firstCheck); await page.waitToClick(selectors.ticketFuture.moveButton); From 61ce25c1e1e22563d7853b1f14b1c072e33e8f18 Mon Sep 17 00:00:00 2001 From: carlossa Date: Tue, 13 Jun 2023 13:32:04 +0200 Subject: [PATCH 4/8] refs #5325 all e2e fix smartTable --- e2e/helpers/selectors.js | 20 +++++++++---------- ..._smartTable_searchBar_integrations.spec.js | 6 +++--- .../05-ticket/01-sale/02_edit_sale.spec.js | 4 ++-- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index 3d5bcddb5..b8eaa99a1 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -523,8 +523,8 @@ export default { searchResultDate: 'vn-ticket-summary [label=Landed] span', topbarSearch: 'vn-searchbar', moreMenu: 'vn-ticket-index vn-icon-button[icon=more_vert]', - fourthWeeklyTicket: 'vn-ticket-weekly-index vn-card smart-table slot-table tr:nth-child(4)', - fiveWeeklyTicket: 'vn-ticket-weekly-index vn-card smart-table slot-table tr:nth-child(5)', + fourthWeeklyTicket: 'vn-ticket-weekly-index vn-card smart-table slot-table tr:nth-child(5)', + fiveWeeklyTicket: 'vn-ticket-weekly-index vn-card smart-table slot-table tr:nth-child(6)', weeklyTicket: 'vn-ticket-weekly-index vn-card smart-table slot-table table tbody tr', firstWeeklyTicketDeleteIcon: 'vn-ticket-weekly-index vn-card smart-table slot-table tr:nth-child(2) vn-icon-button[icon="delete"]', firstWeeklyTicketAgency: 'vn-ticket-weekly-index vn-card smart-table slot-table tr:nth-child(2) [ng-model="weekly.agencyModeFk"]', @@ -606,16 +606,16 @@ export default { firstSaleThumbnailImage: 'vn-ticket-sale:nth-child(1) vn-tr:nth-child(1) vn-td:nth-child(3) > img', firstSaleZoomedImage: 'body > div > div > img', firstSaleQuantity: 'vn-ticket-sale [ng-model="sale.quantity"]', - firstSaleQuantityCell: 'vn-ticket-sale vn-tr:nth-child(2) > vn-td-editable:nth-child(7)', + firstSaleQuantityCell: 'vn-ticket-sale vn-tr:nth-child(1) > vn-td-editable:nth-child(7)', firstSalePrice: 'vn-ticket-sale vn-table vn-tr:nth-child(1) > vn-td:nth-child(9) > span', firstSalePriceInput: '.vn-popover.shown input[ng-model="$ctrl.field"]', firstSaleDiscount: 'vn-ticket-sale vn-table vn-tr:nth-child(1) > vn-td:nth-child(10) > span', firstSaleDiscountInput: '.vn-popover.shown [ng-model="$ctrl.field"]', saveSaleDiscountButton: '.vn-popover.shown vn-button[label="Save"]', - firstSaleImport: 'vn-ticket-sale:nth-child(3) vn-td:nth-child(11)', - firstSaleReservedIcon: 'vn-ticket-sale vn-tr:nth-child(2) > vn-td:nth-child(2) > vn-icon:nth-child(3)', + firstSaleImport: 'vn-ticket-sale:nth-child(1) vn-td:nth-child(11)', + firstSaleReservedIcon: 'vn-ticket-sale vn-tr:nth-child(1) > vn-td:nth-child(2) > vn-icon:nth-child(3)', firstSaleColour: 'vn-ticket-sale vn-tr:nth-child(1) vn-fetched-tags section', - firstSaleCheckbox: 'vn-ticket-sale vn-tr:nth-child(2) vn-check[ng-model="sale.checked"]', + firstSaleCheckbox: 'vn-ticket-sale vn-tr:nth-child(1) vn-check[ng-model="sale.checked"]', secondSaleText: 'vn-table div > vn-tbody > vn-tr:nth-child(2)', secondSaleId: 'vn-ticket-sale:nth-child(2) vn-td-editable:nth-child(4) text > span', secondSaleIdAutocomplete: 'vn-ticket-sale vn-tr:nth-child(2) vn-autocomplete[ng-model="sale.itemFk"]', @@ -625,9 +625,9 @@ export default { secondSaleConceptInput: 'vn-ticket-sale vn-tbody > :nth-child(2) > vn-td-editable.ng-isolate-scope.selected vn-textfield', totalImport: 'vn-ticket-sale vn-one.taxes > p:nth-child(3) > strong', selectAllSalesCheckbox: 'vn-ticket-sale vn-thead vn-check', - secondSaleCheckbox: 'vn-ticket-sale vn-tr:nth-child(3) vn-check[ng-model="sale.checked"]', - thirdSaleCheckbox: 'vn-ticket-sale vn-tr:nth-child(4) vn-check[ng-model="sale.checked"]', - fourthSaleCheckbox: 'vn-ticket-sale vn-tr:nth-child(5) vn-check[ng-model="sale.checked"]', + secondSaleCheckbox: 'vn-ticket-sale vn-tr:nth-child(2) vn-check[ng-model="sale.checked"]', + thirdSaleCheckbox: 'vn-ticket-sale vn-tr:nth-child(3) vn-check[ng-model="sale.checked"]', + fourthSaleCheckbox: 'vn-ticket-sale vn-tr:nth-child(4) vn-check[ng-model="sale.checked"]', deleteSaleButton: 'vn-ticket-sale vn-tool-bar > vn-button[icon="delete"]', transferSaleButton: 'vn-ticket-sale vn-tool-bar > vn-button[icon="call_split"]', moveToTicketInput: 'form vn-input-number[ng-model="$ctrl.transfer.ticketId"] input', @@ -1216,7 +1216,7 @@ export default { addTagButton: 'vn-icon-button[vn-tooltip="Add tag"]', itemTagInput: 'vn-autocomplete[ng-model="itemTag.tagFk"]', itemTagValueInput: 'vn-autocomplete[ng-model="itemTag.value"]', - firstBuy: 'vn-entry-latest-buys tbody > tr:nth-child(1)', + firstBuy: 'vn-entry-latest-buys tbody > tr:nth-child(2)', allBuysCheckBox: 'vn-entry-latest-buys thead vn-check', secondBuyCheckBox: 'vn-entry-latest-buys tbody tr:nth-child(2) vn-check[ng-model="buy.checked"]', editBuysButton: 'vn-entry-latest-buys vn-button[icon="edit"]', diff --git a/e2e/paths/01-salix/03_smartTable_searchBar_integrations.spec.js b/e2e/paths/01-salix/03_smartTable_searchBar_integrations.spec.js index 526afa140..a56f54185 100644 --- a/e2e/paths/01-salix/03_smartTable_searchBar_integrations.spec.js +++ b/e2e/paths/01-salix/03_smartTable_searchBar_integrations.spec.js @@ -19,16 +19,16 @@ describe('SmartTable SearchBar integration', () => { await page.waitToClick(selectors.itemsIndex.openAdvancedSearchButton); await page.autocompleteSearch(selectors.itemsIndex.advancedSearchItemType, 'Anthurium'); await page.waitToClick(selectors.itemsIndex.advancedSearchButton); - await page.waitForNumberOfElements(selectors.itemsIndex.searchResult, 3); + await page.waitForNumberOfElements(selectors.itemsIndex.searchResult, 4); await page.reload({ waitUntil: 'networkidle2' }); - await page.waitForNumberOfElements(selectors.itemsIndex.searchResult, 3); + await page.waitForNumberOfElements(selectors.itemsIndex.searchResult, 4); await page.waitToClick(selectors.itemsIndex.advancedSmartTableButton); - await page.write(selectors.itemsIndex.advancedSmartTableGrouping, '1'); + await page.write(selectors.itemsIndex.advancedSmartTableGrouping, 3); await page.keyboard.press('Enter'); await page.waitForNumberOfElements(selectors.itemsIndex.searchResult, 2); diff --git a/e2e/paths/05-ticket/01-sale/02_edit_sale.spec.js b/e2e/paths/05-ticket/01-sale/02_edit_sale.spec.js index a494a8848..6264073f6 100644 --- a/e2e/paths/05-ticket/01-sale/02_edit_sale.spec.js +++ b/e2e/paths/05-ticket/01-sale/02_edit_sale.spec.js @@ -365,7 +365,7 @@ describe('Ticket Edit sale path', () => { }); it('should confirm the original ticket received the line', async() => { - const expectedLines = 3; + const expectedLines = 4; await page.waitForNumberOfElements(selectors.ticketSales.saleLine, expectedLines); const result = await page.countElement(selectors.ticketSales.saleLine); @@ -402,7 +402,7 @@ describe('Ticket Edit sale path', () => { }); it('should confirm the new ticket received the line', async() => { - const expectedLines = 3; + const expectedLines = 1; const result = await page.countElement(selectors.ticketSales.saleLine); expect(result).toEqual(expectedLines); From 3cef6d642d4d8129cf38dfa8a67edc2a79a0a76f Mon Sep 17 00:00:00 2001 From: carlossa Date: Tue, 13 Jun 2023 14:15:31 +0200 Subject: [PATCH 5/8] refs #5325 smartTable e2e fix --- .../01-salix/03_smartTable_searchBar_integrations.spec.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/e2e/paths/01-salix/03_smartTable_searchBar_integrations.spec.js b/e2e/paths/01-salix/03_smartTable_searchBar_integrations.spec.js index a56f54185..9c37ce9ba 100644 --- a/e2e/paths/01-salix/03_smartTable_searchBar_integrations.spec.js +++ b/e2e/paths/01-salix/03_smartTable_searchBar_integrations.spec.js @@ -27,8 +27,7 @@ describe('SmartTable SearchBar integration', () => { await page.waitForNumberOfElements(selectors.itemsIndex.searchResult, 4); - await page.waitToClick(selectors.itemsIndex.advancedSmartTableButton); - await page.write(selectors.itemsIndex.advancedSmartTableGrouping, 3); + await page.write(selectors.itemsIndex.advancedSmartTableGrouping, '1'); await page.keyboard.press('Enter'); await page.waitForNumberOfElements(selectors.itemsIndex.searchResult, 2); @@ -36,7 +35,7 @@ describe('SmartTable SearchBar integration', () => { waitUntil: 'networkidle2' }); - await page.waitForNumberOfElements(selectors.itemsIndex.searchResult, 2); + await page.waitForNumberOfElements(selectors.itemsIndex.searchResult, 1); }); it('should filter in section without smart-table and search in searchBar go to zone section', async() => { From 66c5eda6f2989c017c2a5d5813c1db03d9039058 Mon Sep 17 00:00:00 2001 From: carlossa Date: Tue, 13 Jun 2023 16:08:11 +0200 Subject: [PATCH 6/8] refs #5325 remove defaultSearch --- front/core/components/smart-table/index.js | 2 ++ modules/claim/front/action/index.js | 1 - modules/claim/front/index/index.js | 1 - modules/client/front/defaulter/index.js | 1 - modules/client/front/extended-list/index.js | 1 - modules/client/front/notification/index.js | 1 - modules/entry/front/latest-buys/index.js | 1 - modules/invoiceOut/front/negative-bases/index.js | 1 - modules/item/front/fixed-price/index.js | 1 - modules/item/front/index/index.js | 1 - modules/item/front/item-shelving/index.js | 1 - modules/monitor/front/index/clients/index.js | 1 - modules/monitor/front/index/tickets/index.js | 1 - modules/route/front/agency-term/index/index.js | 1 - modules/ticket/front/advance/index.js | 1 - modules/ticket/front/expedition/index.js | 1 - modules/ticket/front/future/index.js | 1 - modules/ticket/front/weekly/index.js | 1 - 18 files changed, 2 insertions(+), 17 deletions(-) diff --git a/front/core/components/smart-table/index.js b/front/core/components/smart-table/index.js index b2380a62f..c3b927c62 100644 --- a/front/core/components/smart-table/index.js +++ b/front/core/components/smart-table/index.js @@ -40,6 +40,8 @@ export default class SmartTable extends Component { this._options = options; if (!options) return; + options.defaultSearch = true; + if (options.defaultSearch) this.displaySearch(); diff --git a/modules/claim/front/action/index.js b/modules/claim/front/action/index.js index 6b4879a85..10b629f27 100644 --- a/modules/claim/front/action/index.js +++ b/modules/claim/front/action/index.js @@ -26,7 +26,6 @@ export default class Controller extends Section { activeButtons: { search: true }, - defaultSearch: true, columns: [ { field: 'claimDestinationFk', diff --git a/modules/claim/front/index/index.js b/modules/claim/front/index/index.js index 8e948f426..e3fdabf79 100644 --- a/modules/claim/front/index/index.js +++ b/modules/claim/front/index/index.js @@ -9,7 +9,6 @@ class Controller extends Section { activeButtons: { search: true }, - defaultSearch: true, columns: [ { field: 'clientName', diff --git a/modules/client/front/defaulter/index.js b/modules/client/front/defaulter/index.js index 1244191f1..95c7622f9 100644 --- a/modules/client/front/defaulter/index.js +++ b/modules/client/front/defaulter/index.js @@ -12,7 +12,6 @@ export default class Controller extends Section { activeButtons: { search: true }, - defaultSearch: true, columns: [ { field: 'clientFk', diff --git a/modules/client/front/extended-list/index.js b/modules/client/front/extended-list/index.js index 2cb7a6d58..8eed48d01 100644 --- a/modules/client/front/extended-list/index.js +++ b/modules/client/front/extended-list/index.js @@ -11,7 +11,6 @@ class Controller extends Section { search: true, shownColumns: true, }, - defaultSearch: true, columns: [ { field: 'socialName', diff --git a/modules/client/front/notification/index.js b/modules/client/front/notification/index.js index ada543715..faa062b25 100644 --- a/modules/client/front/notification/index.js +++ b/modules/client/front/notification/index.js @@ -9,7 +9,6 @@ export default class Controller extends Section { activeButtons: { search: true }, - defaultSearch: true, columns: [ { field: 'socialName', diff --git a/modules/entry/front/latest-buys/index.js b/modules/entry/front/latest-buys/index.js index 1a9b3627b..d9065193e 100644 --- a/modules/entry/front/latest-buys/index.js +++ b/modules/entry/front/latest-buys/index.js @@ -14,7 +14,6 @@ export default class Controller extends Section { search: true, shownColumns: true, }, - defaultSearch: true, columns: [ { field: 'code', diff --git a/modules/invoiceOut/front/negative-bases/index.js b/modules/invoiceOut/front/negative-bases/index.js index b70a2f7be..f60668b20 100644 --- a/modules/invoiceOut/front/negative-bases/index.js +++ b/modules/invoiceOut/front/negative-bases/index.js @@ -20,7 +20,6 @@ export default class Controller extends Section { activeButtons: { search: true, }, - defaultSearch: true, columns: [ { field: 'isActive', diff --git a/modules/item/front/fixed-price/index.js b/modules/item/front/fixed-price/index.js index a39cd6602..fe6788e9c 100644 --- a/modules/item/front/fixed-price/index.js +++ b/modules/item/front/fixed-price/index.js @@ -13,7 +13,6 @@ export default class Controller extends Section { activeButtons: { search: true }, - defaultSearch: true, columns: [ { field: 'warehouseFk', diff --git a/modules/item/front/index/index.js b/modules/item/front/index/index.js index f341f6454..10bd4bbb7 100644 --- a/modules/item/front/index/index.js +++ b/modules/item/front/index/index.js @@ -11,7 +11,6 @@ class Controller extends Section { search: true, shownColumns: true, }, - defaultSearch: true, columns: [ { field: 'category', diff --git a/modules/item/front/item-shelving/index.js b/modules/item/front/item-shelving/index.js index 8e5df459d..b8584039b 100644 --- a/modules/item/front/item-shelving/index.js +++ b/modules/item/front/item-shelving/index.js @@ -9,7 +9,6 @@ export default class Controller extends Section { activeButtons: { search: true }, - defaultSearch: true, columns: [ { field: 'parking', diff --git a/modules/monitor/front/index/clients/index.js b/modules/monitor/front/index/clients/index.js index 9faf2ed53..ac3ce9140 100644 --- a/modules/monitor/front/index/clients/index.js +++ b/modules/monitor/front/index/clients/index.js @@ -20,7 +20,6 @@ export default class Controller extends Section { activeButtons: { search: true }, - defaultSearch: true, columns: [ { field: 'clientFk', diff --git a/modules/monitor/front/index/tickets/index.js b/modules/monitor/front/index/tickets/index.js index 92097833b..2f2dead05 100644 --- a/modules/monitor/front/index/tickets/index.js +++ b/modules/monitor/front/index/tickets/index.js @@ -12,7 +12,6 @@ export default class Controller extends Section { search: true, shownColumns: true, }, - defaultSearch: true, columns: [ { field: 'totalProblems', diff --git a/modules/route/front/agency-term/index/index.js b/modules/route/front/agency-term/index/index.js index 6277fb9a1..6c3bafc9a 100644 --- a/modules/route/front/agency-term/index/index.js +++ b/modules/route/front/agency-term/index/index.js @@ -9,7 +9,6 @@ class Controller extends Section { activeButtons: { search: true }, - defaultSearch: true, columns: [ { field: 'agencyModeFk', diff --git a/modules/ticket/front/advance/index.js b/modules/ticket/front/advance/index.js index 0cd1b0981..0cec41227 100644 --- a/modules/ticket/front/advance/index.js +++ b/modules/ticket/front/advance/index.js @@ -11,7 +11,6 @@ export default class Controller extends Section { activeButtons: { search: true, }, - defaultSearch: true, columns: [ { field: 'state', diff --git a/modules/ticket/front/expedition/index.js b/modules/ticket/front/expedition/index.js index 1e30ce447..b8046be52 100644 --- a/modules/ticket/front/expedition/index.js +++ b/modules/ticket/front/expedition/index.js @@ -11,7 +11,6 @@ class Controller extends Section { search: true, shownColumns: true, }, - defaultSearch: true, columns: [ { field: 'packageItemName', diff --git a/modules/ticket/front/future/index.js b/modules/ticket/front/future/index.js index 846c3883f..66d626993 100644 --- a/modules/ticket/front/future/index.js +++ b/modules/ticket/front/future/index.js @@ -10,7 +10,6 @@ export default class Controller extends Section { activeButtons: { search: true, }, - defaultSearch: true, columns: [{ field: 'totalProblems', searchable: false, diff --git a/modules/ticket/front/weekly/index.js b/modules/ticket/front/weekly/index.js index d0a333158..a10ff7184 100644 --- a/modules/ticket/front/weekly/index.js +++ b/modules/ticket/front/weekly/index.js @@ -22,7 +22,6 @@ export default class Controller extends Section { search: true, shownColumns: true, }, - defaultSearch: true, columns: [ { field: 'ticketFk', From 8b832c68b3c1289a5457e3827c791e9a7221797a Mon Sep 17 00:00:00 2001 From: carlossa Date: Thu, 15 Jun 2023 12:49:53 +0200 Subject: [PATCH 7/8] refs #5325 fix back --- modules/ticket/back/methods/ticket-request/specs/filter.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ticket/back/methods/ticket-request/specs/filter.spec.js b/modules/ticket/back/methods/ticket-request/specs/filter.spec.js index ae004a024..565e006fb 100644 --- a/modules/ticket/back/methods/ticket-request/specs/filter.spec.js +++ b/modules/ticket/back/methods/ticket-request/specs/filter.spec.js @@ -173,7 +173,7 @@ describe('ticket-request filter()', () => { const result = await models.TicketRequest.filter(ctx, options); const requestId = result[0].id; - expect(requestId).toEqual(3); + expect(requestId).toEqual(4); await tx.rollback(); } catch (e) { From 7bff915a7f3cb62dba4224e5c6e4ca1731afc0d5 Mon Sep 17 00:00:00 2001 From: carlossa Date: Thu, 15 Jun 2023 17:14:34 +0200 Subject: [PATCH 8/8] refs #5325 back fix correct --- modules/ticket/back/methods/ticket-request/specs/filter.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ticket/back/methods/ticket-request/specs/filter.spec.js b/modules/ticket/back/methods/ticket-request/specs/filter.spec.js index 565e006fb..ae004a024 100644 --- a/modules/ticket/back/methods/ticket-request/specs/filter.spec.js +++ b/modules/ticket/back/methods/ticket-request/specs/filter.spec.js @@ -173,7 +173,7 @@ describe('ticket-request filter()', () => { const result = await models.TicketRequest.filter(ctx, options); const requestId = result[0].id; - expect(requestId).toEqual(4); + expect(requestId).toEqual(3); await tx.rollback(); } catch (e) {