forked from verdnatura/salix-front
Merge pull request 'Fix own test' (!816) from fix_test_jsegarra into dev
Reviewed-on: verdnatura/salix-front#816 Reviewed-by: Alex Moreno <alexm@verdnatura.es>
This commit is contained in:
commit
adbb745f0f
|
@ -1,7 +1,8 @@
|
|||
/// <reference types="cypress" />
|
||||
describe('Ticket descriptor', () => {
|
||||
const toCloneOpt = '[role="menu"] .q-list > :nth-child(8)';
|
||||
const setWeightOpt = '[role="menu"] .q-list > :nth-child(13)';
|
||||
const listItem = '[role="menu"] .q-list .q-item';
|
||||
const toCloneOpt = 'To clone ticket';
|
||||
const setWeightOpt = 'Set weight';
|
||||
const warehouseValue = ':nth-child(1) > :nth-child(6) > .value > span';
|
||||
const summaryHeader = '.summaryHeader > div';
|
||||
const weight = 25;
|
||||
|
@ -14,7 +15,7 @@ describe('Ticket descriptor', () => {
|
|||
it('should clone the ticket without warehouse', () => {
|
||||
cy.visit('/#/ticket/1/summary');
|
||||
cy.openActionsDescriptor();
|
||||
cy.get(toCloneOpt).click();
|
||||
cy.contains(listItem, toCloneOpt).click();
|
||||
cy.clickConfirm();
|
||||
cy.get(warehouseValue).contains('Warehouse One');
|
||||
cy.get(summaryHeader)
|
||||
|
@ -28,7 +29,7 @@ describe('Ticket descriptor', () => {
|
|||
it('should set the weight of the ticket', () => {
|
||||
cy.visit('/#/ticket/10/summary');
|
||||
cy.openActionsDescriptor();
|
||||
cy.get(setWeightOpt).click();
|
||||
cy.contains(listItem, setWeightOpt).click();
|
||||
cy.intercept('POST', /\/api\/Tickets\/\d+\/setWeight/).as('weight');
|
||||
cy.get('.q-dialog input').type(weight);
|
||||
cy.clickConfirm();
|
||||
|
|
|
@ -64,7 +64,7 @@ describe('VnLocation', () => {
|
|||
`${createForm.prefix} > :nth-child(4) > .q-select > ${createForm.sufix} > :nth-child(3) > .q-icon`
|
||||
).click();
|
||||
cy.get(
|
||||
`#q-portal--dialog--4 > .q-dialog > ${createForm.prefix} > .vn-row > .q-select > ${createForm.sufix} > :nth-child(1) input`
|
||||
`#q-portal--dialog--5 > .q-dialog > ${createForm.prefix} > .vn-row > .q-select > ${createForm.sufix} > :nth-child(1) input`
|
||||
).should('have.value', province);
|
||||
});
|
||||
});
|
||||
|
@ -133,6 +133,8 @@ describe('VnLocation', () => {
|
|||
);
|
||||
cy.get('.q-mt-lg > .q-btn--standard').click();
|
||||
cy.get(`${createForm.prefix}`).should('not.exist');
|
||||
cy.waitForElement('.q-form');
|
||||
|
||||
checkVnLocation(postCode, province);
|
||||
});
|
||||
it('Create city', () => {
|
||||
|
@ -144,10 +146,12 @@ describe('VnLocation', () => {
|
|||
cy.get(
|
||||
`${createForm.prefix} > :nth-child(4) > .q-select > ${createForm.sufix} > :nth-child(2) > .q-icon`
|
||||
).click();
|
||||
cy.selectOption('#q-portal--dialog--2 .q-select', 'one');
|
||||
cy.get('#q-portal--dialog--2 .q-input').type(province);
|
||||
cy.get('#q-portal--dialog--2 .q-btn--standard').click();
|
||||
cy.selectOption('#q-portal--dialog--3 .q-select', 'one');
|
||||
cy.get('#q-portal--dialog--3 .q-input').type(province);
|
||||
cy.get('#q-portal--dialog--3 .q-btn--standard').click();
|
||||
cy.get('#q-portal--dialog--1 .q-btn--standard').click();
|
||||
cy.waitForElement('.q-form');
|
||||
|
||||
checkVnLocation(postCode, province);
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue