forked from verdnatura/salix-front
57 lines
2.4 KiB
JavaScript
57 lines
2.4 KiB
JavaScript
|
const locationOptions = '[role="listbox"] > div.q-virtual-scroll__content > .q-item';
|
||
|
describe('VnLocation', () => {
|
||
|
const dialogInputs = '.q-dialog label input';
|
||
|
describe('Worker Create', () => {
|
||
|
const inputLocation = '.q-form input[aria-label="Location"]';
|
||
|
beforeEach(() => {
|
||
|
cy.viewport(1280, 720);
|
||
|
cy.login('developer');
|
||
|
cy.visit('/#/worker/create', { timeout: 5000 });
|
||
|
cy.waitForElement('.q-card');
|
||
|
});
|
||
|
it('Show all options', function () {
|
||
|
cy.get(inputLocation).click();
|
||
|
cy.get(locationOptions).should('have.length.at.least', 5);
|
||
|
});
|
||
|
it('input filter location as "al"', function () {
|
||
|
cy.get(inputLocation).click();
|
||
|
cy.get(inputLocation).clear();
|
||
|
cy.get(inputLocation).type('al');
|
||
|
cy.get(locationOptions).should('have.length.at.least', 3);
|
||
|
});
|
||
|
it('input filter location as "ecuador"', function () {
|
||
|
cy.get(inputLocation).click();
|
||
|
cy.get(inputLocation).clear();
|
||
|
cy.get(inputLocation).type('ecuador');
|
||
|
cy.get(locationOptions).should('have.length.at.least', 1);
|
||
|
});
|
||
|
});
|
||
|
describe('Fiscal-data', () => {
|
||
|
beforeEach(() => {
|
||
|
cy.viewport(1280, 720);
|
||
|
cy.login('developer');
|
||
|
cy.visit('/#/supplier/567/fiscal-data', { timeout: 7000 });
|
||
|
cy.waitForElement('.q-form');
|
||
|
});
|
||
|
it('Create postCode', function () {
|
||
|
cy.get('.q-form > .q-card > .vn-row:nth-child(6) .--add-icon').click();
|
||
|
cy.get('.q-card > h1').should('have.text', 'New postcode');
|
||
|
cy.get(dialogInputs).eq(0).clear('12');
|
||
|
cy.get(dialogInputs).eq(0).type('1234453');
|
||
|
cy.selectOption(
|
||
|
'.q-dialog__inner > .column > #formModel > .q-card > :nth-child(4) > .q-select > .q-field__inner > .q-field__control ',
|
||
|
'Valencia'
|
||
|
);
|
||
|
cy.selectOption(
|
||
|
'.q-dialog__inner > .column > #formModel > .q-card > :nth-child(5) > .q-select > .q-field__inner > .q-field__control ',
|
||
|
'Province one'
|
||
|
);
|
||
|
cy.selectOption(
|
||
|
'.q-dialog__inner > .column > #formModel > .q-card > :nth-child(6) > .q-select > .q-field__inner > .q-field__control ',
|
||
|
'España'
|
||
|
);
|
||
|
cy.get('.q-mt-lg > .q-btn--standard').click();
|
||
|
});
|
||
|
});
|
||
|
});
|