forked from verdnatura/salix-front
Merge pull request 'warmfix_customerList_test' (!1293) from warmfix_customerList_test into test
Reviewed-on: verdnatura/salix-front#1293 Reviewed-by: Alex Moreno <alexm@verdnatura.es>
This commit is contained in:
commit
45b9cffc10
|
@ -191,6 +191,7 @@ const debtWarning = computed(() => {
|
|||
query: {
|
||||
createForm: JSON.stringify({
|
||||
clientFk: entity.id,
|
||||
addressId: entity.defaultAddressFk,
|
||||
}),
|
||||
},
|
||||
}"
|
||||
|
|
|
@ -62,7 +62,7 @@ describe('Client list', () => {
|
|||
it('Client founded create order', () => {
|
||||
const search = 'Jessica Jones';
|
||||
cy.searchByLabel('Name', search);
|
||||
cy.openActionDescriptor('New order');
|
||||
cy.clickButtonWith('icon', 'icon-basketadd');
|
||||
cy.waitForElement('#formModel');
|
||||
cy.waitForElement('.q-form');
|
||||
cy.checkValueForm(1, search);
|
||||
|
|
|
@ -71,7 +71,7 @@ Cypress.Commands.add('getValue', (selector) => {
|
|||
return cy
|
||||
.get(
|
||||
selector +
|
||||
'> .q-field > .q-field__inner > .q-field__control > .q-field__control-container > .q-field__native > input'
|
||||
'> .q-field > .q-field__inner > .q-field__control > .q-field__control-container > .q-field__native > input',
|
||||
)
|
||||
.invoke('val');
|
||||
}
|
||||
|
@ -289,40 +289,13 @@ Cypress.Commands.add('openActionDescriptor', (opt) => {
|
|||
cy.openActionsDescriptor();
|
||||
const listItem = '[role="menu"] .q-list .q-item';
|
||||
cy.contains(listItem, opt).click();
|
||||
1;
|
||||
});
|
||||
|
||||
Cypress.Commands.add('openActionsDescriptor', () => {
|
||||
cy.get('[data-cy="descriptor-more-opts"]').click();
|
||||
});
|
||||
|
||||
Cypress.Commands.add('clickButtonsDescriptor', (id) => {
|
||||
cy.get(`.actions > .q-card__actions> .q-btn:nth-child(${id})`)
|
||||
.invoke('removeAttr', 'target')
|
||||
.click();
|
||||
});
|
||||
|
||||
Cypress.Commands.add('openActionDescriptor', (opt) => {
|
||||
cy.openActionsDescriptor();
|
||||
const listItem = '[role="menu"] .q-list .q-item';
|
||||
cy.contains(listItem, opt).click();
|
||||
1;
|
||||
});
|
||||
|
||||
Cypress.Commands.add('clickButtonsDescriptor', (id) => {
|
||||
cy.get(`.actions > .q-card__actions> .q-btn:nth-child(${id})`)
|
||||
.invoke('removeAttr', 'target')
|
||||
.click();
|
||||
});
|
||||
|
||||
Cypress.Commands.add('openActionDescriptor', (opt) => {
|
||||
cy.openActionsDescriptor();
|
||||
const listItem = '[role="menu"] .q-list .q-item';
|
||||
cy.contains(listItem, opt).click();
|
||||
1;
|
||||
});
|
||||
|
||||
Cypress.Commands.add('clickButtonsDescriptor', (id) => {
|
||||
Cypress.Commands.add('clickButtonDescriptor', (id) => {
|
||||
cy.get(`.actions > .q-card__actions> .q-btn:nth-child(${id})`)
|
||||
.invoke('removeAttr', 'target')
|
||||
.click();
|
||||
|
@ -330,7 +303,7 @@ Cypress.Commands.add('clickButtonsDescriptor', (id) => {
|
|||
|
||||
Cypress.Commands.add('openUserPanel', () => {
|
||||
cy.get(
|
||||
'.column > .q-avatar > .q-avatar__content > .q-img > .q-img__container > .q-img__image'
|
||||
'.column > .q-avatar > .q-avatar__content > .q-img > .q-img__container > .q-img__image',
|
||||
).click();
|
||||
});
|
||||
|
||||
|
@ -356,7 +329,7 @@ Cypress.Commands.add('checkValueForm', (id, search) => {
|
|||
|
||||
Cypress.Commands.add('checkValueSelectForm', (id, search) => {
|
||||
cy.get(
|
||||
`.grid-create > :nth-child(${id}) > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > .q-field__native > .q-field__input`
|
||||
`.grid-create > :nth-child(${id}) > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > .q-field__native > .q-field__input`,
|
||||
).should('have.value', search);
|
||||
});
|
||||
|
||||
|
@ -374,3 +347,21 @@ Cypress.Commands.add('addBtnClick', () => {
|
|||
.and('be.visible')
|
||||
.click();
|
||||
});
|
||||
|
||||
Cypress.Commands.add('clickButtonWith', (type, value) => {
|
||||
switch (type) {
|
||||
case 'icon':
|
||||
cy.clickButtonWithIcon(value);
|
||||
break;
|
||||
|
||||
default:
|
||||
cy.clickButtonWithText(value);
|
||||
break;
|
||||
}
|
||||
});
|
||||
Cypress.Commands.add('clickButtonWithIcon', (iconClass) => {
|
||||
cy.get(`.q-icon.${iconClass}`).parent().click();
|
||||
});
|
||||
Cypress.Commands.add('clickButtonWithText', (buttonText) => {
|
||||
cy.get('.q-btn').contains(buttonText).click();
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue