#8582 - test: e2e monitorTicket #1391

Merged
jsegarra merged 51 commits from e2e_monitor into dev 2025-04-15 21:04:49 +00:00
2 changed files with 29 additions and 26 deletions
Showing only changes of commit 19751ee3fb - Show all commits

View File

@ -9,6 +9,7 @@ import VnInput from 'src/components/common/VnInput.vue';
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
import FetchData from 'src/components/FetchData.vue';
import { dateRange } from 'src/filters';
import VnCheckbox from 'src/components/common/VnCheckbox.vue';
defineProps({ dataKey: { type: String, required: true } });
const { t, te } = useI18n();
@ -198,7 +199,7 @@ const getLocale = (label) => {
<QItemSection>
<VnSelect
dense
rounded
filled
:label="t('globals.params.packing')"
v-model="params.packing"
url="ItemPackingTypes"
@ -209,7 +210,7 @@ const getLocale = (label) => {
</QItem>
<QItem>
<QItemSection>
<QCheckbox
<VnCheckbox
:label="t('params.myTeam')"
v-model="params.myTeam"
toggle-indeterminate
@ -218,7 +219,7 @@ const getLocale = (label) => {
</QItem>
<QItem>
<QItemSection>
<QCheckbox
<VnCheckbox
:label="t('params.problems')"
v-model="params.problems"
toggle-indeterminate
@ -227,7 +228,7 @@ const getLocale = (label) => {
</QItem>
<QItem>
<QItemSection>
<QCheckbox
<VnCheckbox
:label="t('params.pending')"
v-model="params.pending"
toggle-indeterminate

View File

@ -36,28 +36,24 @@ describe('Monitor Tickets Table', () => {
selector: 'Client id_input',
value: '1101',
urlParam: 'clientFk',
rows: 12,
},
{
name: 'Order id',
selector: 'Order id_input',
value: '7',
urlParam: 'orderFk',
rows: 1,
},
{
name: 'Days onward',
selector: 'Days onward_input',
value: '2',
urlParam: 'scopeDays',
rows: 37,
},
{
name: 'Agency',
selector: 'Agency_select',
value: 'inhouse pickup',
urlParam: 'agencyModeFk',
rows: 6,
isSelect: true,
},
{
@ -65,7 +61,6 @@ describe('Monitor Tickets Table', () => {
selector: 'State_select',
value: 'Libre',
urlParam: 'state',
rows: 18,
isSelect: true,
},
{
@ -73,7 +68,6 @@ describe('Monitor Tickets Table', () => {
selector: 'Grouped State_select',
value: 'Free',
urlParam: 'alertLevel',
rows: 24,
isSelect: true,
},
{
@ -81,7 +75,6 @@ describe('Monitor Tickets Table', () => {
selector: 'Warehouse_select',
value: 'Warehouse Two',
urlParam: 'warehouseFk',
rows: 1,
isSelect: true,
},
{
@ -89,7 +82,6 @@ describe('Monitor Tickets Table', () => {
selector: 'ITP_select',
value: 'H',
urlParam: 'packing',
rows: 6,
isSelect: true,
},
{
@ -97,19 +89,15 @@ describe('Monitor Tickets Table', () => {
selector: 'Department_select',
value: 'COMPRAS',
urlParam: 'departmentFk',
rows: 0,
isSelect: true,
},
];
testCases.forEach(
({
name,
selector,
value,
urlParam,
rows,
intercept = interceptSalesFilter,
wait = '@salesRequest',
isSelect,
}) => {
if (intercept) intercept();
@ -124,19 +112,33 @@ describe('Monitor Tickets Table', () => {
cy.searchInFilterPanel();
cy.url().should('include', urlParam);
if (wait) {
cy.waitRequest(wait, () => {
cy.countTableRows('eq', rows);
});
} else {
cy.waitSpinner();
cy.waitSpinner('filterPanel');
cy.countTableRows('eq', rows);
}
cy.cleanFilterPanel();
},
);
// Null to true
cy.get('[data-cy="vnCheckboxMy team"]').click();
cy.get('[data-cy="vnCheckboxWith problems"]').click();
cy.get('[data-cy="vnCheckboxPending"]').click();
cy.searchInFilterPanel();
cy.url().should('include', 'myTeam');
cy.url().should('include', 'problems');
cy.url().should('include', 'pending');
// True to false
cy.get('[data-cy="vnCheckboxMy team"]').click();
cy.get('[data-cy="vnCheckboxWith problems"]').click();
cy.get('[data-cy="vnCheckboxPending"]').click();
cy.searchInFilterPanel();
cy.url().should('include', 'myTeam');
cy.url().should('include', 'problems');
cy.url().should('include', 'pending');
// False to Null
cy.get('[data-cy="vnCheckboxMy team"]').click();
cy.get('[data-cy="vnCheckboxWith problems"]').click();
cy.get('[data-cy="vnCheckboxPending"]').click();
cy.searchInFilterPanel();
cy.url().should('not.include', 'myTeam');
cy.url().should('not.include', 'problems');
cy.url().should('not.include', 'pending');
});
it('Cols', () => {