diff --git a/cypress.config.js b/cypress.config.js index 1934f833e..0e5400c75 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -2,6 +2,7 @@ const { defineConfig } = require('cypress'); module.exports = defineConfig({ e2e: { + experimentalStudio: true, baseUrl: 'http://localhost:9000/', fixturesFolder: 'test/cypress/fixtures', screenshotsFolder: 'test/cypress/screenshots', diff --git a/src/components/ui/VnFilterPanel.vue b/src/components/ui/VnFilterPanel.vue index 722462d4a..17706b3bf 100644 --- a/src/components/ui/VnFilterPanel.vue +++ b/src/components/ui/VnFilterPanel.vue @@ -73,6 +73,7 @@ watch( } else { const parsedParams = JSON.parse(val); userParams.value = { ...parsedParams }; + search(); } } ); @@ -84,9 +85,9 @@ async function search() { store.userParamsChanged = true; store.filter.skip = 0; store.skip = 0; + store.userParams = params; const { params: newParams } = await arrayData.addFilter({ params }); userParams.value = newParams; - if (!props.showAll && !Object.values(params).length) store.data = []; isLoading.value = false; diff --git a/src/composables/useArrayData.js b/src/composables/useArrayData.js index b6b81f2d5..f17778585 100644 --- a/src/composables/useArrayData.js +++ b/src/composables/useArrayData.js @@ -27,6 +27,8 @@ export function useArrayData(key, userOptions) { const query = route.query; if (query.params) { store.userParams = JSON.parse(query.params); + store.skip = 0; + store.filter.skip = 0; } }); diff --git a/test/cypress/integration/invoiceIn/invoiceInList.spec.js b/test/cypress/integration/invoiceIn/invoiceInList.spec.js index ce79dc976..1f1b6f103 100644 --- a/test/cypress/integration/invoiceIn/invoiceInList.spec.js +++ b/test/cypress/integration/invoiceIn/invoiceInList.spec.js @@ -5,12 +5,11 @@ describe('InvoiceInList', () => { ':nth-child(1) > :nth-child(1) > .justify-between > .flex > .q-chip > .q-chip__content'; const firstDetailBtn = '.q-card:nth-child(1) .q-btn:nth-child(2)'; const summaryHeaders = '.summaryBody .header'; - const screen = '.q-page-container > .q-drawer-container > .fullscreen'; beforeEach(() => { cy.login('developer'); cy.visit(`/#/invoice-in/list`); - cy.get(screen).click(); + cy.closeRightMenu(); }); it('should redirect on clicking a invoice', () => { diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js index f075d500f..04d683c20 100755 --- a/test/cypress/support/commands.js +++ b/test/cypress/support/commands.js @@ -170,6 +170,11 @@ Cypress.Commands.add('openRightMenu', (element) => { cy.get('#actions-append').click(); }); +Cypress.Commands.add('closeRightMenu', (element) => { + if (element) cy.waitForElement(element); + cy.get('.q-page-container > .q-drawer-container > .fullscreen').click(); +}); + Cypress.Commands.add('openLeftMenu', (element) => { if (element) cy.waitForElement(element); cy.get('.q-toolbar > .q-btn--round.q-btn--dense > .q-btn__content > .q-icon').click();